|
| 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 | + pull_request: |
| 9 | + paths: |
| 10 | + - .github/workflows/copilot-setup-steps.yml |
| 11 | + |
| 12 | +jobs: |
| 13 | + copilot-setup-steps: |
| 14 | + runs-on: ubuntu-24.04 |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + env: |
| 18 | + CC: gcc-14 |
| 19 | + CXX: g++-14 |
| 20 | + FC: gfortran-14 |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout repo |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Get OS version |
| 27 | + run: lsb_release -d |
| 28 | + |
| 29 | + - name: Install prerequisites |
| 30 | + # Creates setup_env.sh to activate the Python venv; all subsequent steps |
| 31 | + # that need Python or the OFT install must source this file explicitly. |
| 32 | + run: | |
| 33 | + python3 -m venv ${{ github.workspace }}/oft_venv |
| 34 | + echo "source ${{ github.workspace }}/oft_venv/bin/activate" > ${{ github.workspace }}/setup_env.sh |
| 35 | + source ${{ github.workspace }}/setup_env.sh |
| 36 | + python -m pip install pytest numpy scipy h5py triangle matplotlib xarray |
| 37 | +
|
| 38 | + - name: Check compilers |
| 39 | + run: | |
| 40 | + source ${{ github.workspace }}/setup_env.sh |
| 41 | + $CC --version | head -1 > compiler_id.txt |
| 42 | + $CXX --version | head -1 >> compiler_id.txt |
| 43 | + $FC --version | head -1 >> compiler_id.txt |
| 44 | + cat compiler_id.txt |
| 45 | +
|
| 46 | + - name: Cache external libraries |
| 47 | + id: cache-ext-libs |
| 48 | + uses: actions/cache@v4 |
| 49 | + with: |
| 50 | + path: libs |
| 51 | + key: ubuntu-24.04-gcc-14-openmp-${{ hashFiles('src/utilities/build_libs.py', 'compiler_id.txt') }} |
| 52 | + |
| 53 | + - name: Create build dir |
| 54 | + if: ${{ steps.cache-ext-libs.outputs.cache-hit != 'true' }} |
| 55 | + run: mkdir libs |
| 56 | + |
| 57 | + - name: Build external libraries (OpenMP) |
| 58 | + if: ${{ steps.cache-ext-libs.outputs.cache-hit != 'true' }} |
| 59 | + shell: bash |
| 60 | + timeout-minutes: 30 |
| 61 | + working-directory: libs |
| 62 | + run: | |
| 63 | + source ${{ github.workspace }}/setup_env.sh |
| 64 | + 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 |
| 65 | +
|
| 66 | + - name: Upload library failure log |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + if: failure() |
| 69 | + with: |
| 70 | + name: Library_failure_log-ubuntu-24.04_openmp |
| 71 | + path: libs/build/build_error.log |
| 72 | + |
| 73 | + - name: Configure OFT |
| 74 | + shell: bash |
| 75 | + working-directory: libs |
| 76 | + run: | |
| 77 | + source ${{ github.workspace }}/setup_env.sh |
| 78 | + bash config_cmake.sh |
| 79 | +
|
| 80 | + - name: Build OFT |
| 81 | + shell: bash |
| 82 | + working-directory: libs/build_release |
| 83 | + run: | |
| 84 | + source ${{ github.workspace }}/setup_env.sh |
| 85 | + make |
| 86 | +
|
| 87 | + - name: Install OFT |
| 88 | + shell: bash |
| 89 | + working-directory: libs/build_release |
| 90 | + run: | |
| 91 | + source ${{ github.workspace }}/setup_env.sh |
| 92 | + make install |
| 93 | +
|
| 94 | + - name: Fixup cache |
| 95 | + shell: bash |
| 96 | + working-directory: libs |
| 97 | + run: | |
| 98 | + rm -rf build |
0 commit comments