-
Notifications
You must be signed in to change notification settings - Fork 25
80 lines (70 loc) · 2.46 KB
/
Copy pathunit_test.yml
File metadata and controls
80 lines (70 loc) · 2.46 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
on:
push:
branches:
- dev
pull_request:
branches:
- main
- dev
name: Unit Test
jobs:
unit_test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-test-
- name: Test with default features
run: cargo test --release
env:
RUST_BACKTRACE: 1
- name: Test for no_std
run: cargo test --release --no-default-features --features
embassy-rt,core,utils,wallet,models,helpers,websocket,json-rpc
env:
RUST_BACKTRACE: 1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
# Unit-test coverage is scoped via Cargo features rather than path
# exclusion. The minimal feature set (`std,core,utils,wallet,models`)
# compiles only the pure-logic modules — pure crypto, codec, address
# codec, transaction models, and the `signing` module. Integration-
# territory code (CLI, async network clients, sync wrappers around
# network calls, faucet client) is gated behind `helpers`/`json-rpc`/
# `websocket`/`cli` features, so it simply isn't compiled here and
# doesn't appear in the coverage report. Those files are exercised by
# the integration-test workflow against a live rippled.
- name: Generate coverage report
run: |
cargo llvm-cov \
--no-default-features --features std,core,utils,wallet,models \
--lcov --output-path lcov.info
- name: Check coverage thresholds
run: |
cargo llvm-cov --summary-only \
--no-default-features --features std,core,utils,wallet,models \
--fail-under-lines 83 \
--fail-under-regions 85 \
--fail-under-functions 73
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
flags: unit
fail_ci_if_error: true
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: lcov-report
path: lcov.info