Update example #82
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: Ubuntu | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-ubuntu: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04] | |
compiler: [gcc, clang] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Configure CMake for gcc | |
if: matrix.compiler == 'gcc' | |
run: | | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCODE_COVERAGE=ON -B build | |
- name: Configure CMake for clang | |
if: matrix.compiler == 'clang' | |
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build | |
- name: Build | |
run: cmake --build build | |
- name: Run tests | |
run: ./build/tests/run_tests | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'gcc' | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |