Add coverage to actions #59
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: Tests | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Tests | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: ilammy/[email protected] | |
with: | |
arch: win32 | |
- name: Install OpenCppCoverage and codecov | |
run: | | |
choco install opencppcoverage codecov | |
refreshenv | |
- name: Run Release Tests | |
run: | | |
cmake -B build-release -G Ninja -DSINKER_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release | |
cmake --build build-release --target check-sinker --config Release | |
- name: Run Debug Tests and Coverage | |
run: | | |
cmake -B build-debug -G Ninja -DSINKER_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug | |
OpenCppCoverage --export_type cobertura:coverage.xml --modules sinker-tests* --sources *sinker/sinker* --cover_children -- cmake --build build-debug --target check-sinker --config Debug | |
- uses: actions/checkout@main | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true |