Skip to content

Commit

Permalink
Compact the code coverage tasks
Browse files Browse the repository at this point in the history
There is no need to run twice the tests the same way.
  • Loading branch information
lu-zero committed Aug 18, 2023
1 parent 7acce86 commit 8898e9e
Showing 1 changed file with 1 addition and 58 deletions.
59 changes: 1 addition & 58 deletions .github/workflows/libp2p-rust-dht.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,47 +233,6 @@ jobs:
exit 1
fi
weighted-code-coverage:

needs: [build, docs]

runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: mysecretpassword
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v3

- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Install grcov
env:
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download
GRCOV_VERSION: v0.8.13
GRCOV_BINARY: grcov-x86_64-unknown-linux-musl.tar.bz2
run: |
curl -L "$GRCOV_LINK/$GRCOV_VERSION/$GRCOV_BINARY" |
tar xj -C $HOME/.cargo/bin
- name: Install weighted-code-coverage
env:
WCC_LINK: https://github.com/SoftengPoliTo/weighted-code-coverage/releases/download
Expand All @@ -283,23 +242,7 @@ jobs:
curl -L "$WCC_LINK/$WCC_VERSION/$WCC_BINARY" |
tar xz -C $HOME/.cargo/bin
- name: Install llvm-tools-preview
run: |
rustup component add llvm-tools-preview
# Not necessary on a newly created image, but strictly advised
- name: Run cargo clean
run: |
cargo clean
- name: Run tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "libp2p-rust-dht-%p-%m.profraw"
run: |
cargo test --verbose --all
- name: Run grcov
- name: Run grcov to produce a coveralls json
run: |
grcov . --binary-path ./target/debug/ -t coveralls -s . --token YOUR_COVERALLS_TOKEN > coveralls.json
Expand Down

0 comments on commit 8898e9e

Please sign in to comment.