File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Code Coverage
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ coverage :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v3
16+
17+ - name : Install Rust
18+ uses : actions-rs/toolchain@v1
19+ with :
20+ toolchain : stable
21+ components : llvm-tools-preview
22+ override : true
23+
24+ - name : Install grcov
25+ run : cargo install grcov
26+
27+ - name : Generate code coverage
28+ env :
29+ CARGO_INCREMENTAL : " 0"
30+ RUSTFLAGS : " -Cinstrument-coverage"
31+ RUSTDOCFLAGS : " -Cinstrument-coverage"
32+ LLVM_PROFILE_FILE : " coverage-%p-%m.profraw"
33+ run : |
34+ cargo test --workspace --all-targets
35+ grcov . \
36+ --binary-path ./target/debug/ \
37+ -s . \
38+ -t cobertura \
39+ --branch \
40+ --ignore-not-existing \
41+ --ignore "/*" \
42+ -o coverage.xml
43+
44+ - name : Upload coverage to Codecov
45+ uses : codecov/codecov-action@v3
46+ with :
47+ files : coverage.xml
48+ fail_ci_if_error : true
You can’t perform that action at this time.
0 commit comments