Skip to content

Commit

Permalink
Add build-hpc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Nov 22, 2024
1 parent 156ea96 commit d7c89b0
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,81 @@ jobs:
# uses: codecov/codecov-action@v2
# with:
# files: ${{ steps.build-test.outputs.coverage_file }}

ci-hpc:
name: ci-hpc
runs-on: [self-hosted, linux, hpc]
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: ecmwf-actions/reusable-workflows/ci-hpc-generic@v2
with:
site: ac-batch
troika_user: ${{ secrets.HPC_CI_SSH_USER }}
sbatch_options: |
#SBATCH --time=00:20:00
#SBATCH --nodes=1
#SBATCH --ntasks=2
#SBATCH --cpus-per-task=32
#SBATCH --gpus-per-task=1
#SBATCH --mem=200G
#SBATCH --qos=dg
template_data: |
modules:
- cmake
- ninja
- ecbuild
- prgenv/nvidia
- hpcx-openmpi
- fftw
cmake_options:
- -DENABLE_MPI=ON
- -DENABLE_ACC=ON
- -DENABLE_GPU=ON
dependencies:
ecmwf-ifs/fiat:
version: develop
cmake_options:
- -DENABLE_MPI=ON
template: |
{% for module in modules %}
module load {{module}}
{% endfor %}
#git clone -b develop ${{ github.server_url}}/ecmwf-ifs/fiat
#cmake -G Ninja -S fiat -B build-fiat -DENABLE_MPI=ON
#cmake --build build-fiat
#cmake --install build-fiat --prefix install-fiat
{% for name, options in dependencies.items() %}
mkdir -p {{name}}
pushd {{name}}
git init
git remote add origin ${{ github.server_url}}/{{name}}
git fetch origin {{options['version']}}
git reset --hard FETCH_HEAD
cmake -G Ninja -S . -B build {{ options['cmake_options']|join(' ') }}
cmake --build build
cmake --install build --prefix install
popd
{% endfor %}
mkdir -p ${{ github.repository }}
pushd ${{ github.repository }}
git init
git remote add origin ${{ github.server_url }}/${{ github.repository }}
git fetch origin ${{ github.sha }}
git reset --hard FETCH_HEAD
cmake -G Ninja -S . -B build \
{% for name in dependencies %}
{% set org, proj = name.split('/') %}
-D{{proj}}_DIR=$PWD/{{name}}/install/lib64/cmake/{{proj}} \
{% endfor %}
{{ cmake_options|join(' ') }}
#-Dfiat_DIR=$PWD/install-fiat/lib64/cmake/fiat \
cmake --build build
ctest --test-dir build

0 comments on commit d7c89b0

Please sign in to comment.