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@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.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@d438492cf8a250514fa2d34b30bc3c0dc37c65ff # v2.87.8
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
version: v11.3.1
files: ./lcov.info
flags: rust
name: codecov-electrum-streaming-client
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false