File tree 5 files changed +64
-0
lines changed
5 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 84
84
with :
85
85
command : clippy
86
86
args : -- -D warnings
87
+
88
+ coverage :
89
+ name : coverage
90
+ runs-on : ubuntu-latest
91
+ steps :
92
+ - uses : actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
93
+ - uses : actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
94
+ with :
95
+ profile : minimal
96
+ toolchain : stable
97
+ override : true
98
+ - uses : taiki-e/install-action@5794068c211bc8f5f4514b7c3f03d6adbe66f1b7 # v2.26.18
99
+ with :
100
+ tool : cargo-tarpaulin
101
+ - name : Generate unit-tests coverage
102
+ run : make coverage-unit-tests
103
+ - name : Upload unit-tests coverage to Codecov
104
+ uses : codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1
105
+ env :
106
+ CODECOV_TOKEN : ${{ secrets.CODECOV_ORG_TOKEN }}
107
+ with :
108
+ name : unit-tests
109
+ directory : coverage/unit-tests
110
+ flags : unit-tests
111
+ verbose : true
112
+ - name : Generate integration-tests coverage
113
+ run : make coverage-integration-tests
114
+ - name : Upload unit-tests coverage to Codecov
115
+ uses : codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1
116
+ env :
117
+ CODECOV_TOKEN : ${{ secrets.CODECOV_ORG_TOKEN }}
118
+ with :
119
+ name : integration-tests
120
+ directory : coverage/integration-tests
121
+ flags : integration-tests
122
+ verbose : true
Original file line number Diff line number Diff line change 2
2
bom-cargo.json
3
3
/bin
4
4
/registry
5
+
6
+ # coverage instrumentation:
7
+ * .profraw
Original file line number Diff line number Diff line change @@ -31,6 +31,23 @@ unit-tests: fmt lint
31
31
integration-tests : fmt lint
32
32
cargo test --test ' *'
33
33
34
+ .PHONY : coverage
35
+ coverage : coverage-unit-tests coverage-integration-tests
36
+
37
+ .PHONY : coverage-unit-tests
38
+ coverage-unit-tests :
39
+ # integration-tests with llvm need +nightly. Hence, enable +nightly on
40
+ # unit-tests, and use --skip-clean to not recompile on CI if not needed
41
+ cargo tarpaulin --verbose --skip-clean --engine=llvm \
42
+ --all-features --lib --bin --follow-exec \
43
+ --out xml --out html --output-dir coverage/unit-tests
44
+
45
+ .PHONY : coverage-integration-tests
46
+ coverage-integration-tests :
47
+ cargo tarpaulin --verbose --skip-clean --engine=llvm \
48
+ --all-features --test integration_test --follow-exec \
49
+ --out xml --out html --output-dir coverage/integration-tests
50
+
34
51
.PHONY : clean
35
52
clean :
36
53
cargo clean
Original file line number Diff line number Diff line change
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ ! .gitignore
Original file line number Diff line number Diff line change
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ ! .gitignore
You can’t perform that action at this time.
0 commit comments