-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (78 loc) · 2.36 KB
/
forge-coverage.yml
File metadata and controls
91 lines (78 loc) · 2.36 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: "Measure test coverage for a Forge project"
on:
workflow_call:
inputs:
cache-path:
default: |
cache
node_modules
out
out-optimized
required: false
type: "string"
foundry-version:
default: "v1.3.6"
description: "Foundry version to use"
required: false
type: "string"
match-path:
required: true
type: "string"
name:
default: "Forge coverage"
required: false
type: "string"
# This flag allows coverage with via-ir enabled for the "minimum amount of optimization" necessary.
via-ir-minimum:
default: false
required: false
type: "boolean"
working-directory:
default: "."
required: false
type: "string"
secrets:
CODECOV_TOKEN:
required: true
MAINNET_RPC_URL:
required: false
ROUTEMESH_API_KEY:
required: false
jobs:
forge-coverage:
name: ${{ inputs.name }}
defaults:
run:
working-directory: ${{ inputs.working-directory }}
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
ROUTEMESH_API_KEY: ${{ secrets.ROUTEMESH_API_KEY }}
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
with:
version: ${{ inputs.foundry-version }}
- name: "Restore the cached build"
uses: "sablier-labs/gha-utils/.github/actions/evm-cache@main"
with:
cache-path: ${{ inputs.cache-path }}
fail-on-cache-miss: true
- name: "Generate the coverage report"
run: | # shell
if [ "${{ inputs.via-ir-minimum }}" == "true" ]; then
forge coverage --match-path "${{ inputs.match-path }}" --report lcov --ir-minimum
else
forge coverage --match-path "${{ inputs.match-path }}" --report lcov
fi
- name: "Upload coverage report to Codecov"
uses: "codecov/codecov-action@v4"
with:
files: "./lcov.info"
token: ${{ secrets.CODECOV_TOKEN }}
- name: "Add summary"
run: | # shell
echo "## Forge Coverage result" >> $GITHUB_STEP_SUMMARY
echo "✅ Uploaded to Codecov" >> $GITHUB_STEP_SUMMARY