-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (35 loc) · 1.04 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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