-
Notifications
You must be signed in to change notification settings - Fork 110
65 lines (56 loc) · 1.78 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
on:
workflow_call:
inputs:
package_folder:
required: true
type: string
files_to_ignore:
required: false
type: string
default: ""
coverage_args:
required: false
type: string
default: ""
env:
package_folder: ${{ inputs.package_folder }}
FOUNDRY_PROFILE: ci
jobs:
check:
strategy:
fail-fast: true
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install node deps and foundry
uses: ./.github/actions/setup_deps
- name: Cache build
uses: ./.github/actions/cache_foundry_build
with:
package_folder: ${{ env.package_folder }}
foundry_profile: coverage
- name: Run Forge coverage
run: cd $package_folder && forge coverage --report lcov ${{ inputs.coverage_args }} --lcov-version 2
env:
TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
CONDUIT_KEY: ${{ secrets.CONDUIT_KEY }}
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1
- name: Filter files to ignore
run: |
cd ./${{ env.package_folder }} && lcov --rc lcov_branch_coverage=1 \
--remove lcov.info \
--ignore-errors unused \
--output-file lcov.info "*node_modules*" "*test*" "*script*" ${{ inputs.files_to_ignore }}
- name: Report code coverage
uses: iainnash/github-actions-report-lcov@v12
with:
output-html: false
coverage-files: ./${{ env.package_folder }}/lcov.info
minimum-coverage: 87
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./${{ env.package_folder }}