File tree Expand file tree Collapse file tree 3 files changed +452
-401
lines changed Expand file tree Collapse file tree 3 files changed +452
-401
lines changed Original file line number Diff line number Diff line change
1
+ name : Coverage
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main", "develop" ]
6
+ pull_request :
7
+ branches : [ "main", "develop" ]
8
+
9
+ env :
10
+ CARGO_TERM_COLOR : always
11
+
12
+ jobs :
13
+ unit-tests-coverage :
14
+ name : Unit Tests Coverage
15
+ runs-on : ubuntu-latest
16
+
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+ - uses : actions-rs/toolchain@v1
20
+ with :
21
+ toolchain : nightly
22
+ override : true
23
+ - name : Install deps
24
+ run : |
25
+ rustup component add llvm-tools-preview
26
+ grcov --version || cargo install --locked grcov
27
+ - name : Run tests
28
+ run : |
29
+ rm -rf target/coverage
30
+ mkdir -p target/coverage
31
+ cargo test --verbose
32
+ env :
33
+ CARGO_INCREMENTAL : ' 0'
34
+ RUSTFLAGS : ' -Cinstrument-coverage'
35
+ RUSTDOCFLAGS : ' -Cinstrument-coverage'
36
+ LLVM_PROFILE_FILE : ' target/coverage/unittests-%p-%m.profraw'
37
+ - name : Collect Report
38
+ run : |
39
+ grcov target/coverage --binary-path "target/debug/" \
40
+ -s src -t lcov --branch --ignore-not-existing \
41
+ --ignore "*/tests/*" \
42
+ --ignore "*/tests.rs" \
43
+ -o coverage-report.info
44
+ - name : Codecov
45
+ uses : codecov/codecov-action@v5
46
+ env :
47
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
48
+ with :
49
+ # Repository upload token - get it from codecov.io. Required only for private repositories
50
+ # token: # optional
51
+ # Specify whether the Codecov output should be verbose
52
+ verbose : true
53
+ fail_ci_if_error : true
You can’t perform that action at this time.
0 commit comments