Skip to content

Commit

Permalink
Build(contracts): add coverage report in /contracts (#373)
Browse files Browse the repository at this point in the history
Co-authored-by: vincent <[email protected]>
Co-authored-by: HAOYUatHZ <[email protected]>
  • Loading branch information
3 people committed Mar 18, 2023
1 parent fdd8fcb commit 26e4363
Showing 1 changed file with 19 additions and 16 deletions.
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

0 comments on commit 26e4363

Please sign in to comment.