Update actions/coverage #9
Workflow file for this run
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
# Measure code coverage using Codecov | ||
name: coverage | ||
on: | ||
push: | ||
branches: coverage | ||
pull_request: | ||
branches: coverage | ||
jobs: | ||
run: | ||
name: Measure code coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install llvm | ||
run: sudo apt install -y llvm | ||
- name: Get source | ||
uses: actions/checkout@v3 | ||
- name: Configure CMake | ||
run: > | ||
CXX=clang cmake -B ${{github.workspace}}/build | ||
-DCMAKE_BUILD_TYPE=Coverage | ||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build | ||
- name: Run tests | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
export LLVM_PROFILE_FILE=./gf2.profraw | ||
test/testgf2 | ||
llvm-profdata merge -sparse gf2.profraw -o gf2.profdata | ||
llvm-cov show ./test/testgf2 -instr-profile=gf2.profdata > coverage.txt | ||
- name: Upload coverage to Codecov | ||
working-directory: ${{github.workspace}}/build | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: coverage.txt | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
fail_ci_if_error: true | ||
verbose: true |