Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build(contracts): add coverage report in /contracts #373

Merged
merged 15 commits into from
Mar 17, 2023
35 changes: 19 additions & 16 deletions .github/workflows/contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,10 @@ name: Contracts

on:
push:
branches:
- master
- main
- prod
- release/*
- staging
- develop
- alpha
paths:
- 'contracts/**'
- '.github/workflows/contracts.yaml'
pull_request:
branches:
- master
- main
- prod
- release/*
- staging
- develop
- alpha
paths:
- 'contracts/**'
- '.github/workflows/contracts.yaml'
Expand All @@ -44,6 +28,9 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1

- name: Install Node.js 14
uses: actions/setup-node@v2
Expand Down Expand Up @@ -80,6 +67,22 @@ jobs:
- name: Run foundry tests
run: forge test -vvv

- name: Run foundry coverage
run : forge coverage --report lcov

- name : Prune coverage
run : lcov --remove ./lcov.info -o ./lcov.info.pruned 'src/mocks/*' 'src/test/*' 'scripts/*' 'node_modules/*' 'lib/*'

- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v3
with:
coverage-files: contracts/lcov.info.pruned
minimum-coverage: 0
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: contracts
update-comment: true

hardhat:
runs-on: ubuntu-latest

Expand Down