From 053c748d3d7aee674bada24609612bde9ba1420e Mon Sep 17 00:00:00 2001 From: Cayle Sharrock Date: Tue, 27 Jun 2023 22:07:07 +0100 Subject: [PATCH] fix: push test coverage even if some tests fail (#5533) Description --- Our test coverage shows 0% because the GA fails if even one test fails (and the integration tests typically have at least one failure). So allow the coverage report to complete even without a clean bill of health. Remote caching was also disabled for this GA, since the compiler flags are different for code coverage runs. Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify --- .github/workflows/coverage.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b8b5fe7719..ddc89c0c89 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,7 @@ --- +# Notes for this action: +# Restoring caches is largely useless, since the compiler flags are only useful for code coverage runs. +# This GA is self-hosted, and has local caching solutions. name: Source Coverage 'on': @@ -32,25 +35,9 @@ jobs: toolchain: nightly components: llvm-tools-preview - - name: caching (nightly) - # Don't use rust-cache. - # Rust-cache disables a key feature of actions/cache: restoreKeys. - # Without restore keys, we lose the ability to get partial matches on caches, and end - # up with too many cache misses. - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/index - ~/.cargo/registry/cache - ~/.cargo/registry/CACHEDIR.TAG - ~/.cargo/git - target - key: tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly-${{ hashFiles('**/Cargo.lock') }} - tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly - - name: cargo test + # Prepare the coverage data, even if some tests fail + continue-on-error: true env: RUSTFLAGS: "-C instrument-coverage" RUSTDOCFLAGS: "-C instrument-coverage"