Skip to content

Update actions/coverage #13

Update actions/coverage

Update actions/coverage #13

Workflow file for this run

# 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 reports to Codecov
working-directory: ${{github.workspace}}/build
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
run:
bash <(curl -s https://codecov.io/bash) -f coverage.txt