generated from 42cursus-youkim/project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 1.54 KB
/
codecov.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Codecov
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- name: build
working-directory: test
run: |
mkdir build
cd build
cmake ..
make -j
- name: run test
working-directory: test/build
run: |
create_coverage() {
if [[ $1 == 'text' ]]; then
file=coverage.txt
else
file=coverage.html
fi
llvm-cov show ./irc_test \
--instr-profile=coverage.profdata \
--ignore-filename-regex='../tests/*' \
--ignore-filename-regex='_deps/*' \
--Xdemangler c++filt \
--format="$1" > "$file"
}
export LLVM_PROFILE_FILE='irc_test.profraw'
./irc_test
llvm-profdata merge -sparse 'irc_test.profraw' -o coverage.profdata
create_coverage text
create_coverage html
- name: upload coverage
working-directory: test/build
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov
- name: archive coverage
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: ./test/build/coverage.html