File tree 1 file changed +47
-0
lines changed
1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 90
90
91
91
- run : cargo check ${{ matrix.RUST.FLAGS }}
92
92
93
+ coverage :
94
+ runs-on : ubuntu-latest
95
+ steps :
96
+ - uses : actions/checkout@v3
97
+ with :
98
+ persist-credentials : false
99
+
100
+ - uses : dtolnay/rust-toolchain@1ce4a7352a1efe5dede2e52c75512b34256e4f44
101
+ with :
102
+ toolchain : nightly
103
+ components : llvm-tools-preview
104
+
105
+ - uses : actions/cache@v3
106
+ id : cargo-cache
107
+ with :
108
+ path : |
109
+ ~/.cargo/bin/
110
+ ~/.cargo/registry/index/
111
+ ~/.cargo/registry/cache/
112
+ ~/.cargo/git/db/
113
+ target/
114
+ key : ${{ runner.os }}-cargo-4-${{ hashFiles('**/Cargo.toml') }}
115
+
116
+ - run : cargo install cargo-binutils
117
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
118
+
119
+ - run : cargo test
120
+ env :
121
+ RUSTFLAGS : " -Cinstrument-coverage"
122
+ LLVM_PROFILE_FILE : " rust-cov/cov-%m-%p.profraw"
123
+
124
+ - run : |
125
+ set -xe
126
+ cargo profdata -- merge -sparse rust-cov/*.profraw -o cargo-test-rust-cov.profdata
127
+ cargo cov -- export \
128
+ $(env RUSTFLAGS="-Cinstrument-coverage" cargo test --tests --no-run --message-format=json | jq -r "select(.profile.test == true) | .filenames[]") \
129
+ -instr-profile=cargo-test-rust-cov.profdata \
130
+ --ignore-filename-regex='/.cargo/registry' \
131
+ --ignore-filename-regex='/rustc/' \
132
+ --ignore-filename-regex='/.rustup/toolchains/' --format=lcov > cargo-test.lcov
133
+
134
+ genhtml cargo-test.lcov -o coverage-html
135
+
136
+ with :
137
+ name : coverage-html
138
+ path : coverage-html
139
+
93
140
fuzz :
94
141
runs-on : ubuntu-latest
95
142
strategy :
You can’t perform that action at this time.
0 commit comments