Repository navigation
69 lines (58 loc) · 2.47 KB
/
Copy pathcoverage.yml
File metadata and controls
69 lines (58 loc) · 2.47 KB
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
name: Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
# --timeout: tarpaulin's default 60s per-test timeout is shorter than the
# instrumented runtime of the compliance/treasury scaling tests (which
# drive thousands of contract calls through the test host), so it
# aborted the whole run with "Timed out waiting for test response".
- name: Generate coverage report
run: cargo tarpaulin --workspace --out xml --timeout 1800
# ── Aggregate upload ────────────────────────────────────────────────
# Uploads the full workspace coverage report so the project-level and
# patch status checks in codecov.yml can evaluate overall coverage.
- name: Upload coverage to Codecov (aggregate)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
fail_ci_if_error: false
# ── Per-contract flag uploads ────────────────────────────────────────
# Each contract gets its own upload under a named flag. Codecov uses the
# `flags[].paths` entries in codecov.yml to scope each flag to its
# contract's source tree, enabling per-contract coverage tracking and
# carryforward behaviour between commits.
- name: Upload coverage to Codecov (invoice flag)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
flags: invoice
fail_ci_if_error: false
- name: Upload coverage to Codecov (treasury flag)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
flags: treasury
fail_ci_if_error: false
- name: Upload coverage to Codecov (compliance flag)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
flags: compliance
fail_ci_if_error: false