From e43b3fae1341c7814089aa3f06c354114172921c Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sat, 11 May 2024 19:54:02 +0100 Subject: [PATCH 1/2] ci: add code coverage --- .github/workflows/{build.yml => ci.yml} | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) rename .github/workflows/{build.yml => ci.yml} (71%) diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 71% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml index c6d53a6d..93b03b7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Build & Test Pop-CLI +name: ci on: push: @@ -49,8 +49,31 @@ jobs: git-user: ${{ env.GITHUB_ACTOR }} - name: Run unit tests - run: cargo test --lib + run: cargo test --lib --bins + coverage: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + with: + git-user: ${{ env.GITHUB_ACTOR }} + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lib --bins --codecov --output-path codecov.json + + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: codecov.json + fail_ci_if_error: true + contract-integration-tests: needs: lint runs-on: ubuntu-latest From 03709bf8c49c0c5cf94bc7afb51b236d217bd573 Mon Sep 17 00:00:00 2001 From: Frank Bell Date: Sat, 11 May 2024 21:19:40 +0100 Subject: [PATCH 2/2] chore: add codecov.yml --- codecov.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..c2d6709a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +# https://docs.codecov.com/docs/common-recipe-list +coverage: + status: + project: + default: + target: auto + threshold: 0% +comment: + layout: " diff, flags, files" + behavior: default + require_changes: false + require_base: false + require_head: true + hide_project_coverage: false