-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (46 loc) · 1.17 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
name: Measure test coverage
on:
push:
branches: [ main ]
paths:
- '**.rs'
- '**.toml'
- '.github/workflows/**'
pull_request:
branches: [ main ]
paths:
- '**.rs'
- '**.toml'
- '.github/workflows/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Setup
run: |
rustup component add llvm-tools-preview
cargo install grcov
- name: Checkout code
uses: actions/checkout@v3
- name: Measure test coverage
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "coverage-%m-%p.profraw"
run: |
cargo test -p pop3-codec --all-features
grcov . \
--source-dir . \
--binary-path target/debug \
--branch \
--keep-only 'pop3-codec/src/**' \
--output-types "lcov" \
--llvm > coveralls.lcov
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
format: lcov
file: coveralls.lcov