Skip to content

Commit 8898e9e

Browse files
committed
Compact the code coverage tasks
There is no need to run twice the tests the same way.
1 parent 7acce86 commit 8898e9e

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

.github/workflows/libp2p-rust-dht.yml

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -233,47 +233,6 @@ jobs:
233233
exit 1
234234
fi
235235
236-
weighted-code-coverage:
237-
238-
needs: [build, docs]
239-
240-
runs-on: ubuntu-latest
241-
242-
services:
243-
postgres:
244-
image: postgres
245-
env:
246-
POSTGRES_PASSWORD: mysecretpassword
247-
options: >-
248-
--health-cmd pg_isready
249-
--health-interval 10s
250-
--health-timeout 5s
251-
--health-retries 5
252-
ports:
253-
- 5432:5432
254-
255-
steps:
256-
- uses: actions/checkout@v3
257-
258-
- name: Install protobuf compiler
259-
run: |
260-
sudo apt-get update
261-
sudo apt-get install protobuf-compiler
262-
263-
- name: Install Rust stable
264-
uses: dtolnay/rust-toolchain@stable
265-
with:
266-
toolchain: stable
267-
268-
- name: Install grcov
269-
env:
270-
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
271-
GRCOV_VERSION: v0.8.13
272-
GRCOV_BINARY: grcov-x86_64-unknown-linux-musl.tar.bz2
273-
run: |
274-
curl -L "$GRCOV_LINK/$GRCOV_VERSION/$GRCOV_BINARY" |
275-
tar xj -C $HOME/.cargo/bin
276-
277236
- name: Install weighted-code-coverage
278237
env:
279238
WCC_LINK: https://github.com/SoftengPoliTo/weighted-code-coverage/releases/download
@@ -283,23 +242,7 @@ jobs:
283242
curl -L "$WCC_LINK/$WCC_VERSION/$WCC_BINARY" |
284243
tar xz -C $HOME/.cargo/bin
285244
286-
- name: Install llvm-tools-preview
287-
run: |
288-
rustup component add llvm-tools-preview
289-
290-
# Not necessary on a newly created image, but strictly advised
291-
- name: Run cargo clean
292-
run: |
293-
cargo clean
294-
295-
- name: Run tests
296-
env:
297-
RUSTFLAGS: "-Cinstrument-coverage"
298-
LLVM_PROFILE_FILE: "libp2p-rust-dht-%p-%m.profraw"
299-
run: |
300-
cargo test --verbose --all
301-
302-
- name: Run grcov
245+
- name: Run grcov to produce a coveralls json
303246
run: |
304247
grcov . --binary-path ./target/debug/ -t coveralls -s . --token YOUR_COVERALLS_TOKEN > coveralls.json
305248

0 commit comments

Comments
 (0)