From b8807ed7f7a2ca1fd1d9a485b1af9e085375a28b Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 23 Oct 2020 11:25:00 +0200 Subject: [PATCH 1/4] CI: Run tests via `cargo-tarpaulin` --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5645e7e7583..b9392e4b081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,8 +197,10 @@ jobs: cargo fmt -- --check cargo clippy --all-targets --all-features --all - - name: Test - run: cargo test + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1.3 + with: + version: '0.17.0' - name: Prune unnecessary cache run: script/ci/prune-cache.sh From 76d6191fa11544a4b9d3386a806f8ccdfdc194c7 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Tue, 24 Nov 2020 15:32:27 +0100 Subject: [PATCH 2/4] CI: Install `cargo-tarpaulin` regularly --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9392e4b081..6dc70cb7567 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,10 +197,8 @@ jobs: cargo fmt -- --check cargo clippy --all-targets --all-features --all - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1.3 - with: - version: '0.17.0' + - run: cargo install cargo-tarpaulin + - run: cargo tarpaulin - name: Prune unnecessary cache run: script/ci/prune-cache.sh From 3daadd99cecd85314e367bb997860a63f062c481 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sat, 30 Jan 2021 21:13:13 +0100 Subject: [PATCH 3/4] CI: Remove `-C debuginfo=0` from `RUSTFLAGS` Having this flag is preventing tarpaulin from providing us with test coverage reports and I can't find any documented reason for why we would need this. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dc70cb7567..0cdf8dbc927 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: DATABASE_URL: postgres://postgres:postgres@localhost/cargo_registry_test TEST_DATABASE_URL: postgres://postgres:postgres@localhost/cargo_registry_test CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C debuginfo=0 -D warnings" + RUSTFLAGS: "-D warnings" MALLOC_CONF: "background_thread:true,abort_conf:true,abort:true,junk:true" services: From 23bae6813e1254c48e46b456b0b3af261d83be3a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sat, 30 Jan 2021 21:18:01 +0100 Subject: [PATCH 4/4] CI: Install and run tarpaulin only on `stable` --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cdf8dbc927..cea3611b338 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,8 +197,17 @@ jobs: cargo fmt -- --check cargo clippy --all-targets --all-features --all - - run: cargo install cargo-tarpaulin - - run: cargo tarpaulin + - name: Install cargo-tarpaulin + if: matrix.rust == 'stable' + run: which cargo-tarpaulin || cargo install cargo-tarpaulin + + - name: Run tests (with coverage report) + if: matrix.rust == 'stable' + run: cargo tarpaulin + + - name: Run tests + if: matrix.rust != 'stable' + run: cargo test - name: Prune unnecessary cache run: script/ci/prune-cache.sh