|
| 1 | +name: Ubuntu Rolling Matrix |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, adaptiveDt ] |
| 6 | + paths-ignore: '**/*.md' |
| 7 | + pull_request: |
| 8 | + branches: [ main ] |
| 9 | + paths-ignore: '**/*.md' |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ubuntu-rolling-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + runs-on: ubuntu-rolling |
| 18 | + |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + compiler: [gcc, gcc-12, clang] |
| 23 | + sanitizer: [none, asan] |
| 24 | + build_type: [Release] |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: | |
| 31 | + sudo apt-get update |
| 32 | + sudo apt-get install -y libomp-dev libhdf5-dev |
| 33 | +
|
| 34 | + # Install gcc-12 if needed |
| 35 | + if [[ "${{ matrix.compiler }}" == "gcc-12" ]]; then |
| 36 | + sudo apt-get install -y gcc-12 g++-12 |
| 37 | + fi |
| 38 | +
|
| 39 | + - name: Configure CMake |
| 40 | + run: | |
| 41 | + CC=${{ matrix.compiler }} |
| 42 | + CXX=${{ matrix.compiler }}++ |
| 43 | +
|
| 44 | + # gcc-12 special case |
| 45 | + if [[ "${{ matrix.compiler }}" == "gcc-12" ]]; then |
| 46 | + CC=gcc-12 |
| 47 | + CXX=g++-12 |
| 48 | + fi |
| 49 | +
|
| 50 | + SAN_FLAGS="" |
| 51 | + if [[ "${{ matrix.sanitizer }}" == "asan" ]]; then |
| 52 | + SAN_FLAGS="-fsanitize=address -fno-omit-frame-pointer" |
| 53 | + fi |
| 54 | +
|
| 55 | + cmake -B build -S . \ |
| 56 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ |
| 57 | + -DCMAKE_C_COMPILER=$CC \ |
| 58 | + -DCMAKE_CXX_COMPILER=$CXX \ |
| 59 | + -DCMAKE_C_FLAGS="$SAN_FLAGS" \ |
| 60 | + -DCMAKE_CXX_FLAGS="$SAN_FLAGS" |
| 61 | +
|
| 62 | + - name: Build |
| 63 | + run: cmake --build build --config ${{ matrix.build_type }} |
| 64 | + |
| 65 | + - name: Test |
| 66 | + working-directory: build |
| 67 | + run: ctest --output-on-failure --build-config ${{ matrix.build_type }} |
| 68 | + |
| 69 | + - name: Upload binaries |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: rolling-${{ matrix.compiler }}-${{ matrix.sanitizer }} |
| 73 | + path: build/next |
0 commit comments