Skip to content

Distributed GPRat

Distributed GPRat #218

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Install compilers and static analyzers
if: matrix.os == 'ubuntu-24.04'
run: >-
sudo apt-get install cppcheck -y -q
sudo update-alternatives --install
/usr/bin/clang-tidy clang-tidy
/usr/bin/clang-tidy-18 150
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-18 150
- name: Set up Spack
uses: spack/setup-spack@v2
with:
ref: releases/v0.23
color: true # Force color output (SPACK_COLOR=always)
path: spack
- name: Register repository
run: spack repo add spack-repo
- name: Choose environment
run: |
cp spack-repo/environments/spack_cpu_gcc.yaml spack.yaml
cat spack-repo/environments/ci_env_settings.yaml.tpl >> spack.yaml
- name: Concretize
run: spack -e . concretize
- name: Install
run: spack -e . install --no-check-signature
- name: Configure
env:
CC: gcc-14
CXX: g++-14
shell: spack-bash {0}
run: |
spack env activate .
cmake "--preset=ci-${{ matrix.os }}"
- name: Build
run: cmake --build build --config Release -j 2
- name: Install
run: cmake --install build --config Release --prefix prefix
- name: Test
working-directory: build
run: ctest --output-on-failure --no-tests=ignore -C Release -j 2
- name: Upload
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.os }}
path: |
prefix/
- name: Configure example project
env:
CC: gcc-14
CXX: g++-14
shell: spack-bash {0}
run: |
spack env activate .
cmake -G "Unix Makefiles" -S examples/gprat_cpp -B build_examples -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PWD/prefix -DUSE_MKL=ON
- name: Build example project
run: cmake --build build_examples --config Release -j 2
# See: https://github.com/spack/setup-spack?tab=readme-ov-file#example-caching-your-own-binaries-for-public-repositories
- name: Push packages and update index
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: spack -e . buildcache push --base-image ubuntu:24.04 --update-index local-buildcache
# The owner must match the namespace in /spack-repo/environments/ci_env_settings.yaml.tpl
if: ${{ !cancelled() && github.repository_owner == 'SC-SGS' && github.event_name != 'pull_request' }}