Skip to content

Commit

Permalink
Refactor GitHub Actions for OS-specific CMake configs
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Jun 17, 2024
1 parent 8cbde3f commit 101f3d0
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,48 @@ name: Test

on: push

env:
BUILD_TYPE: Release

jobs:
build:
name: Running on ${{matrix.os}}
name: Test on ${{ matrix.os }} with build type ${{ matrix.build_type }}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Release, Debug]

steps:
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
if: runner.os == 'Linux'
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUSE_SANITIZER='Address;Undefined'
-DENABLE_ALL_WARNINGS=ON
- name: Configure CMake
if: runner.os == 'macOS'
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DENABLE_ALL_WARNINGS=ON
- name: Configure CMake
if: runner.os == 'Windows'
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: >
cmake
--build ${{github.workspace}}/build
--config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
run: ctest -C ${{matrix.build_type}} --output-on-failure

0 comments on commit 101f3d0

Please sign in to comment.