Skip to content

Create ubuntu-rolling.yml #1

Create ubuntu-rolling.yml

Create ubuntu-rolling.yml #1

name: Ubuntu Rolling Matrix
on:
push:
branches: [ main, adaptiveDt ]
paths-ignore: '**/*.md'
pull_request:
branches: [ main ]
paths-ignore: '**/*.md'
concurrency:
group: ubuntu-rolling-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-rolling
strategy:
fail-fast: false
matrix:
compiler: [gcc, gcc-12, clang]
sanitizer: [none, asan]
build_type: [Release]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libomp-dev libhdf5-dev
# Install gcc-12 if needed
if [[ "${{ matrix.compiler }}" == "gcc-12" ]]; then
sudo apt-get install -y gcc-12 g++-12
fi
- name: Configure CMake
run: |
CC=${{ matrix.compiler }}
CXX=${{ matrix.compiler }}++
# gcc-12 special case
if [[ "${{ matrix.compiler }}" == "gcc-12" ]]; then
CC=gcc-12
CXX=g++-12
fi
SAN_FLAGS=""
if [[ "${{ matrix.sanitizer }}" == "asan" ]]; then
SAN_FLAGS="-fsanitize=address -fno-omit-frame-pointer"
fi
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_C_FLAGS="$SAN_FLAGS" \
-DCMAKE_CXX_FLAGS="$SAN_FLAGS"
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Test
working-directory: build
run: ctest --output-on-failure --build-config ${{ matrix.build_type }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: rolling-${{ matrix.compiler }}-${{ matrix.sanitizer }}
path: build/next