-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (62 loc) · 1.95 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
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
name: coverage
on:
push:
branches:
- master
paths-ignore:
- 'coverage/**'
env:
CARGO_TERM_COLOR: always
jobs:
build_coverage:
name: picori
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly
steps:
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: install
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
components: llvm-tools-preview
- name: grcov
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
- name: coverage
env:
RUSTFLAGS: '-Cinstrument-coverage'
LLVM_PROFILE_FILE: 'temp/coverage/coverage-%p-%m.profraw'
CARGO_INCREMENTAL: '0'
run: |
ls -lah
mkdir -p temp
cargo build --verbose
cargo test --verbose
./grcov . --binary-path ./target/debug/ -s . -t html --llvm --branch \
--ignore-not-existing --ignore "/*" --ignore "examples/**" --ignore "scripts/**" \
-o ./temp/coverage/ \
--excl-start "grcov-excl-start" \
--excl-stop "grcov-excl-stop" \
--excl-line "grcov-excl-line|#\\[derive\\(|//!" \
--excl-br-line "(#\\[derive\\()|(debug_assert)"
- name: upload coverage
env:
CI_COMMIT_AUTHOR: CI
CI_COMMIT_MESSAGE: CI Coverage Report
if: github.event_name == 'push'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "username@users.noreply.github.com"
git fetch
git checkout coverage --
rm -rf coverage
cp -r temp/coverage/ coverage
git add coverage
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push