Refactor GitHub Actions for OS-specific CMake configs #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: push | |
jobs: | |
build: | |
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 | |
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 ${{matrix.build_type}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure |