Test all stds in different jobs #281
Workflow file for this run
This file contains hidden or 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: build | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '.vscode/**' | |
- 'LICENSE' | |
- 'README.md' | |
pull_request: | |
paths-ignore: | |
- '.vscode/**' | |
- 'LICENSE' | |
- 'README.md' | |
workflow_dispatch: | |
env: | |
CTEST_OUTPUT_ON_FAILURE: ON | |
CTEST_PARALLEL_LEVEL: 2 | |
jobs: | |
test: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Ubuntu 24.04 GCC, C++11 (Debug)", | |
os: ubuntu-24.04, | |
build_type: "Debug", | |
std: "11", | |
sanitizers: "ON", | |
} | |
- { | |
name: "Ubuntu Latest GCC, C++17 (Debug)", | |
os: ubuntu-latest, | |
build_type: "Debug", | |
std: "17", | |
sanitizers: "OFF", | |
} | |
- { | |
name: "Ubuntu Latest GCC, C++11 (Release)", | |
os: ubuntu-latest, | |
build_type: "Release", | |
std: "11", | |
sanitizers: "OFF", | |
} | |
- { | |
name: "macOS Latest Clang, C++11 (Release)", | |
os: macos-latest, | |
build_type: "Release", | |
std: "11", | |
sanitizers: "OFF", | |
} | |
- { | |
name: "Windows Latest, C++11 (Release)", | |
os: windows-latest, | |
build_type: "Release", | |
std: "11", | |
sanitizers: "OFF", | |
} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/build | |
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.config.std }} -DCPP_CHANNEL_BUILD_EXAMPLES=ON -DCPP_CHANNEL_BUILD_TESTS=ON -DCPP_CHANNEL_SANITIZERS=${{ matrix.config.sanitizers }} | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: cmake --build . --config ${{ matrix.config.build_type }} --target tests -j | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{ matrix.config.build_type }} --verbose -R channel_test --output-on-failure -j | |
- name: Run examples | |
working-directory: ${{github.workspace}}/build | |
run: cmake --build . --config ${{ matrix.config.build_type }} --target examples -j | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
working-directory: ${{github.workspace}}/build | |
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -DCPP_CHANNEL_BUILD_TESTS=ON -DCPP_CHANNEL_COVERAGE=ON | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: cmake --build . --config Debug --target tests | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C Debug --verbose -R channel_test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
clang-format: | |
name: Clang Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run Clang Format | |
run: clang-format --dry-run --Werror $(find include -type f) |