forked from OpenFUSIONToolkit/OpenFUSIONToolkit
-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (86 loc) · 3.13 KB
/
Copy pathcopilot-setup-steps.yml
File metadata and controls
101 lines (86 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Copilot Setup Steps
# Setup steps for GitHub Copilot agents to compile and test OFT.
# Mirrors the Ubuntu 24.04 GCC + OpenMP configuration used in ci_build.yaml.
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
- src/utilities/build_libs.py
jobs:
copilot-setup-steps:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Get OS version
run: lsb_release -d
- name: Install prerequisites
# Creates setup_env.sh to activate the Python venv; all subsequent steps
# that need Python or the OFT install must source this file explicitly.
# CC/CXX/FC are written to GITHUB_ENV here because Copilot ignores job-level
# env: settings and only honours steps, permissions, runs-on, services,
# snapshot, and timeout-minutes.
run: |
echo "CC=gcc-14" >> $GITHUB_ENV
echo "CXX=g++-14" >> $GITHUB_ENV
echo "FC=gfortran-14" >> $GITHUB_ENV
python3 -m venv ${{ github.workspace }}/oft_venv
echo "source ${{ github.workspace }}/oft_venv/bin/activate" > ${{ github.workspace }}/setup_env.sh
source ${{ github.workspace }}/setup_env.sh
python -m pip install pytest numpy scipy h5py netcdf4 matplotlib
- name: Check compilers
run: |
source ${{ github.workspace }}/setup_env.sh
$CC --version | head -1 > compiler_id.txt
$CXX --version | head -1 >> compiler_id.txt
$FC --version | head -1 >> compiler_id.txt
cat compiler_id.txt
- name: Cache external libraries
id: cache-ext-libs
uses: actions/cache@v5
with:
path: builds
key: ubuntu-24.04-gcc-14-openmp-${{ hashFiles('src/utilities/build_libs.py', 'compiler_id.txt') }}
- name: Create build dir
if: ${{ steps.cache-ext-libs.outputs.cache-hit != 'true' }}
run: mkdir builds
- name: Build external libraries
if: ${{ steps.cache-ext-libs.outputs.cache-hit != 'true' }}
shell: bash
timeout-minutes: 30
working-directory: builds
run: |
source ${{ github.workspace }}/setup_env.sh
python ../src/utilities/build_libs.py --build_umfpack=1 --build_superlu=1 --no_dl_progress --nthread=4 --build_arpack=1 --oft_build_tests=1 --build_mpich=1
- name: Upload library failure log
uses: actions/upload-artifact@v6
if: failure()
with:
name: Library_failure_log-ubuntu-24.04_openmp
path: builds/build/build_error.log
- name: Configure OFT
shell: bash
working-directory: builds
run: |
source ${{ github.workspace }}/setup_env.sh
bash config_cmake.sh
- name: Build OFT
shell: bash
working-directory: builds/build_release
run: |
source ${{ github.workspace }}/setup_env.sh
make
- name: Install OFT
shell: bash
working-directory: builds/build_release
run: |
source ${{ github.workspace }}/setup_env.sh
make install
- name: Fixup cache
shell: bash
working-directory: builds
run: |
rm -rf build