From 0ce6b6022f51ac784f957f5038ded2018b6c7770 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 19:05:35 +0100 Subject: [PATCH 01/11] Run grcov and codecov manually in CI --- .github/actions-rs/grcov.yml | 6 ------ .github/workflows/test.yml | 23 ++++++++++++----------- 2 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 .github/actions-rs/grcov.yml diff --git a/.github/actions-rs/grcov.yml b/.github/actions-rs/grcov.yml deleted file mode 100644 index d70ee56d0..000000000 --- a/.github/actions-rs/grcov.yml +++ /dev/null @@ -1,6 +0,0 @@ -branch: true -ignore-not-existing: true -llvm: true -output-type: lcov -output-file: ./lcov.info -prefix-dir: /home/user/build/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19e0916a0..d79b0c98b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -153,7 +153,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: nightly-2020-12-10 override: true - uses: actions-rs/cargo@v1 with: @@ -162,13 +162,14 @@ jobs: with: command: test-all-features env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=unwind -Zpanic_abort_tests" - - uses: actions-rs/grcov@v0.1 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ${{ steps.coverage.outputs.report }} - yml: ./codecov.yml - fail_ci_if_error: true + RUSTFLAGS: '-Zinstrument-coverage' + - name: Install grcov + run: | + rustup component add llvm-tools-preview + curl -L https://github.com/mozilla/grcov/releases/download/v0.7.1/grcov-linux-x86_64.tar.bz2 | tar jxf - + - name: Run grcov + run: | + ./grcov . --source-dir . --binary-path ./target/debug/ --output-type lcov --output-path ./lcov.info --ignore-not-existing + - name: Upload to Codecov + run: | + bash <(curl -s https://codecov.io/bash) -f ./lcov.info From 28af1dd2f8125348061cb0e3db387f96ae46f1d3 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 19:31:04 +0100 Subject: [PATCH 02/11] Bump nightly to latest --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d79b0c98b..d0df9f7a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -153,7 +153,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2020-12-10 + toolchain: nightly override: true - uses: actions-rs/cargo@v1 with: From 2e130e1315e405d185c5de24fb1530a9cca8e9a1 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 21:09:40 +0100 Subject: [PATCH 03/11] Run cargo test manually --- .github/workflows/test.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0df9f7a8..43ddcf6d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -153,14 +153,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: + profile: minimal toolchain: nightly override: true - - uses: actions-rs/cargo@v1 - with: - command: clean - - uses: actions-rs/cargo@v1 - with: - command: test-all-features + - run: cargo test --lib -p tendermint-abci -p tendermint-light-client -p tendermint-light-node -p tendermint-p2p -p tendermint-proto -p tendermint-rpc -p tendermint -p tendermint-testgen -p tendermint-pbt-gen --all-features env: RUSTFLAGS: '-Zinstrument-coverage' - name: Install grcov From 0d445ba709927ef87da380292e4e4cd96e032c0f Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 21:19:45 +0100 Subject: [PATCH 04/11] Run cargo test manually --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43ddcf6d1..bd0dc1e43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -156,7 +156,7 @@ jobs: profile: minimal toolchain: nightly override: true - - run: cargo test --lib -p tendermint-abci -p tendermint-light-client -p tendermint-light-node -p tendermint-p2p -p tendermint-proto -p tendermint-rpc -p tendermint -p tendermint-testgen -p tendermint-pbt-gen --all-features + - run: cargo test --lib --all-features env: RUSTFLAGS: '-Zinstrument-coverage' - name: Install grcov From 226f3e17a618be66bf4166f2ea8ae5147c38c229 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 21:29:28 +0100 Subject: [PATCH 05/11] Run cargo test manually --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd0dc1e43..d368ba795 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -156,7 +156,7 @@ jobs: profile: minimal toolchain: nightly override: true - - run: cargo test --lib --all-features + - run: cargo test --all-features env: RUSTFLAGS: '-Zinstrument-coverage' - name: Install grcov From 257bda820230a91b60f540bc481bff652418fb58 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 22:39:36 +0100 Subject: [PATCH 06/11] Use grcov 0.6.1 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d368ba795..b7365f9de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -162,7 +162,7 @@ jobs: - name: Install grcov run: | rustup component add llvm-tools-preview - curl -L https://github.com/mozilla/grcov/releases/download/v0.7.1/grcov-linux-x86_64.tar.bz2 | tar jxf - + curl -L https://github.com/mozilla/grcov/releases/download/v0.6.1/grcov-linux-x86_64.tar.bz2 | tar jxf - - name: Run grcov run: | ./grcov . --source-dir . --binary-path ./target/debug/ --output-type lcov --output-path ./lcov.info --ignore-not-existing From 83aa1c185ef3ba8ebb5bbec48eddf591884a0471 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Thu, 25 Mar 2021 23:41:09 +0100 Subject: [PATCH 07/11] Prevent *.profraw overwrites --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7365f9de..ab1c268b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -159,6 +159,7 @@ jobs: - run: cargo test --all-features env: RUSTFLAGS: '-Zinstrument-coverage' + LLVM_PROFILE_FILE: '%m.profraw' - name: Install grcov run: | rustup component add llvm-tools-preview From a43add3c9fa3ed099fa47e4792607da17f2ce7d1 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Fri, 26 Mar 2021 00:55:12 +0100 Subject: [PATCH 08/11] Add a 30-minute timeout to kvstore-integration-latest CI job --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab1c268b5..3ecffdef6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,6 +146,7 @@ jobs: with: command: test-all-features args: --manifest-path tools/kvstore-test/Cargo.toml + timeout-minutes: 30 nightly-coverage: runs-on: ubuntu-latest From 5e57fa3d4bc16e544f8a55fc2eb0fb8e3b976398 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Fri, 26 Mar 2021 09:00:20 +0100 Subject: [PATCH 09/11] Pin nightly version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ecffdef6..436b7fade 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -155,7 +155,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2021-03-25 override: true - run: cargo test --all-features env: From 3f9563aacf9fd51da5ff418dcad697c776c64c90 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Fri, 26 Mar 2021 09:52:43 +0100 Subject: [PATCH 10/11] Back to cargo test through github action --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 436b7fade..dedd83505 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -157,7 +157,9 @@ jobs: profile: minimal toolchain: nightly-2021-03-25 override: true - - run: cargo test --all-features + - uses: actions-rs/cargo@v1 + with: + command: test-all-features env: RUSTFLAGS: '-Zinstrument-coverage' LLVM_PROFILE_FILE: '%m.profraw' From 381cb081c9474cfce23df0fe6d47428e4ef9d2a5 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Fri, 26 Mar 2021 10:23:43 +0100 Subject: [PATCH 11/11] Parse branch coverage info --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dedd83505..a560daa87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -169,7 +169,7 @@ jobs: curl -L https://github.com/mozilla/grcov/releases/download/v0.6.1/grcov-linux-x86_64.tar.bz2 | tar jxf - - name: Run grcov run: | - ./grcov . --source-dir . --binary-path ./target/debug/ --output-type lcov --output-path ./lcov.info --ignore-not-existing + ./grcov . --source-dir . --binary-path ./target/debug/ --output-type lcov --output-path ./lcov.info --branch --ignore-not-existing - name: Upload to Codecov run: | bash <(curl -s https://codecov.io/bash) -f ./lcov.info