-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 2.07 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Code Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
# Allow manual triggering
workflow_dispatch:
jobs:
coverage:
name: Generate coverage report
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "coverage-cache"
- name: Generate code coverage
run: |
cargo +nightly tarpaulin \
--verbose \
--workspace \
--timeout 300 \
--out Xml \
--out Html \
--out Json \
--fail-under 60 \
--exclude-files 'tests/*' \
-- \
--test-threads 2
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: cobertura.xml
flags: unittests
name: codecov-umbrella
verbose: true
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: |
cobertura.xml
tarpaulin-report.html
coverage.json
retention-days: 14
- name: Create Coverage Comment
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: coverage.json
message: |
### Code Coverage Report 📊
Coverage report for commit ${{ github.sha }}
<details>
<summary>Coverage Details</summary>
```
${{ steps.coverage.outputs.report }}
```
</details>
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LOG: debug
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true