Skip to content

Add .github/copilot-instructions.md for cloud agent onboarding #5

Add .github/copilot-instructions.md for cloud agent onboarding

Add .github/copilot-instructions.md for cloud agent onboarding #5

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
env:
CC: gcc-14
CXX: g++-14
FC: gfortran-14
steps:
- name: Checkout repo
uses: actions/checkout@v4
- 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.
run: |
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 matplotlib xarray
- 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@v4
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 (OpenMP)
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 --oblas_dynamic_arch --build_umfpack=1 --build_superlu=1 --no_dl_progress --nthread=4 --build_arpack=1 --oft_build_tests=1
- name: Upload library failure log
uses: actions/upload-artifact@v4
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