use latest codecov action #44
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: C/C++ CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
gcc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure with CMake | |
run: cmake -DBUILD_TEST:bool=ON -S . -B build_cmake | |
- name: Build (CMake) | |
run: cmake --build build_cmake | |
- name: Run tests (CMake) | |
run: cd build_cmake && ctest && cd .. | |
clang: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure with CMake | |
run: cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DBUILD_TEST:bool=ON -S . -B build_cmake | |
- name: Build (CMake) | |
run: cmake --build build_cmake | |
- name: Run tests (CMake) | |
run: cd build_cmake && ctest && cd .. | |
coverage: | |
runs-on: ubuntu-latest | |
container: jeandet/simple_cxx_fedora | |
steps: | |
- uses: actions/checkout@v3 | |
- name: update Meson | |
run: python3 -m pip install meson -U | |
- name: Configure with Meson | |
run: meson -Db_coverage=true . build | |
- name: Build (meson) | |
run: ninja -C build | |
- name: Run tests (meson) | |
run: ninja test -C build | |
- name: Generate Coverage repport | |
run: | | |
lcov --capture --directory . --output-file coverage.info | |
lcov --remove coverage.info '/usr/*' --output-file coverage.info | |
lcov --remove coverage.info '*/catch.hpp' --output-file coverage.info | |
lcov --list coverage.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.info | |
flags: unittests | |
name: codecov-cdfpp | |
yml: ./codecov.yml | |
fail_ci_if_error: true |