Merge pull request #189 from clEsperanto/dependabot/github_actions/lu… #610
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: CI-Tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
name: ${{ matrix.os }}-${{ matrix.buildtype }}-Test-and-Coverage | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 1 | |
matrix: | |
buildtype: [Debug] | |
os: [macos-latest] | |
cxx: [clang++] | |
cc: [clang] | |
triplet: [x64-osx] | |
packages: [lcov gcovr] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install packages | |
shell: bash | |
run: | | |
brew install ${{ matrix.packages }} | |
- name: Cmake configure | |
shell: bash | |
run: | | |
cmake -S ${{ github.workspace }} -B ${{ runner.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} -DBUILD_COVERAGE=ON -DBUILD_BENCHMARK=OFF | |
- name: Cmake build | |
shell: bash | |
run: | | |
cmake --build "${{ runner.workspace }}/build" --parallel 10 --config ${{ matrix.buildtype }} | |
- name: Generate coverage | |
shell: bash | |
run: | | |
cd ${{ runner.workspace }}/build && ctest -C ${{ matrix.buildtype }} --output-on-failure | |
# - name: Format coverage | |
# shell: bash | |
# run: | | |
# cd ${{ runner.workspace }}/build | |
# lcov --directory . --capture --output-file coverage.info | |
# lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info | |
# lcov --list coverage.info | |
- name: Format coverage | |
shell: bash | |
run: | | |
cd ${{ runner.workspace }}/build | |
gcovr --root .. --output coverage.xml | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: ${{ runner.workspace }}/build/coverage.xml | |
fail_ci_if_error: true # optional (default = false) |