From 8e88f606366eea8293c3466481b61458e5112b5f Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 8 Jan 2024 18:32:32 +0100 Subject: [PATCH] feat(ci): add evm coverage --- .github/workflows/coverage.yml | 38 ++++++++++++++++++++++++++++++++++ evm/evm.nix | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..362f842975 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,38 @@ +name: Coverage + +on: + pull_request: + branches: + - main + +permissions: read-all + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + report: + runs-on: ubuntu-latest + needs: [build] + permissions: write-all + steps: + - uses: actions/download-artifact@v3 + with: + name: packages.x86_64-linux.evm-coverage + - uses: nixbuild/nix-quick-install-action@v22 + - uses: nixbuild/nixbuild-action@master + with: + nixbuild_token: ${{ secrets.nixbuild_token }} + - uses: actions/download-artifact@v3 + - uses: hrishikesh-kadam/setup-lcov@v1 + - name: Build coverage + run: | + nix --extra-experimental-features nix-command --extra-experimental-features flakes build .#evm-coverage + - name: Report code coverage + uses: zgosalvez/github-actions-report-lcov@v3 + with: + coverage-files: result/lcov.info + minimum-coverage: 90 + github-token: ${{ secrets.GITHUB_TOKEN }} + update-comment: true diff --git a/evm/evm.nix b/evm/evm.nix index 9568fe818e..485e84e439 100644 --- a/evm/evm.nix +++ b/evm/evm.nix @@ -313,7 +313,7 @@ }; evm-coverage = - pkgs.runCommand "evm-coverage.log" + pkgs.runCommand "evm-coverage" { buildInputs = [ wrappedForge pkgs.lcov ]; } ''