From c4bd33205c07f0b49fb6b0adcb50f3b3653e0ab3 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Sat, 26 Aug 2023 18:02:21 +0200 Subject: [PATCH] Conditional skip of code coverage --- .github/workflows/build_and_test.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d844256..398c52f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -35,6 +35,13 @@ jobs: cache-all-crates: "true" - name: Build, Test and Publish Coverage run: | - curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash - cargo binstall --no-confirm cargo-tarpaulin --force - cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120 + if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then + curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + cargo binstall --no-confirm cargo-tarpaulin --force + cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120 + else + echo "Code Coverage step is skipped on forks!" + cargo build --verbose --all-features + cargo test --verbose --all-features + fi +