-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (31 loc) · 1.09 KB
/
code-coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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.