Skip to content

Commit 798e061

Browse files
Copilothansec
andcommitted
Add copilot-setup-steps.yml for GitHub Copilot agent environment setup
Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
1 parent 52791ad commit 798e061

1 file changed

Lines changed: 104 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)