PR feedback #532
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Coverage | |
on: [push] | |
env: | |
## Loads environment from secrets | |
ETH_RPC_URL: ${{secrets.ETH_RPC_URL}} | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
# Report code coverage to discord | |
- name: Generate coverage | |
run: forge coverage --report lcov --no-match-test invariant | |
- name: Setup LCOV | |
uses: hrishikesh-kadam/setup-lcov@v1 | |
- name: Filter lcov | |
run: | | |
lcov -r lcov.info "script/*" "test/*" -o lcov-filtered.info --rc lcov_branch_coverage=1 > coverage-summary.txt | |
echo "$(tail -4 coverage-summary.txt)" > coverage-summary.txt | |
- name: Verify coverage level | |
uses: zgosalvez/github-actions-report-lcov@v1 | |
with: | |
coverage-files: ./lcov-filtered.info | |
minimum-coverage: 90 # Set coverage threshold. | |
# github-token: ${{ secrets.GITHUB_TOKEN }} # Adds a coverage summary comment to the PR. |