Repository navigation
80 lines (67 loc) · 2.37 KB
/
Copy pathcode_coverage.yml
File metadata and controls
80 lines (67 loc) · 2.37 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
70
71
72
73
74
75
76
77
78
79
80
name: Code Coverage
# Combines coverage from both feature configurations, including doctests and
# branches. LCOV and HTML reports are saved as an artifact; Codecov upload
# errors do not fail the job. Public fork PRs can upload without a token.
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
jobs:
Coverage:
name: Coverage
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
with:
toolchain: nightly-2026-09-01
components: llvm-tools-preview
cache: true
cache-key: coverage
rustflags: ""
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@a4d3f3f761dcd95cce1b72cb61cb6d1963438177 # v2.87.30
with:
tool: cargo-llvm-cov@0.9.1
- name: Generate coverage
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --locked --no-default-features \
--no-report --branch
cargo llvm-cov --locked --all-features \
--no-report --doctests --branch
cargo llvm-cov report --doctests --branch \
--lcov --output-path lcov.info
cargo llvm-cov report --doctests --branch --html
- name: Upload coverage artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage-report
path: |
lcov.info
target/llvm-cov/html
if-no-files-found: error
retention-days: 14
- name: Codecov upload
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
version: v11.3.1
files: ./lcov.info
flags: rust
name: codecov-electrum-streaming-client
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false