-
Notifications
You must be signed in to change notification settings - Fork 32
101 lines (87 loc) · 2.8 KB
/
foundry-tests.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
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
92
93
94
95
96
97
98
99
100
101
name: Foundry Tests
on:
pull_request:
paths:
- 'packages/contracts-core/**'
push:
paths:
- 'packages/contracts-core/**'
- '.github/workflows/foundry-tests.yml'
jobs:
cancel-outdated:
name: Cancel Outdated Jobs
runs-on: ubuntu-latest
steps:
- id: skip_check
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) != github.ref && !contains(github.event.head_commit.message, '[no_skip]') }}
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
coverage:
name: Foundry Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node JS
uses: ./.github/actions/setup-nodejs
- name: Installing dependencies
working-directory: ./packages/contracts-core
run: yarn install --immutable
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Foundry Tests
working-directory: ./packages/contracts-core
run: forge coverage -vvv --report lcov --report summary >> $GITHUB_STEP_SUMMARY
- name: Send Coverage (Codecov)
uses: Wandalen/[email protected]
with:
action: codecov/codecov-action@v3
current_path: ./packages/contracts-core/
with: |
token: ${{ secrets.CODECOV }}
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
flags: solidity
attempt_limit: 5
attempt_delay: 30000
snapshot:
runs-on: ubuntu-latest
name: Foundry Gas Snapshot
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node JS
uses: ./.github/actions/setup-nodejs
- name: Installing dependencies
working-directory: ./packages/contracts-core
run: yarn install --immutable
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run snapshot
working-directory: ./packages/contracts-core
run: forge snapshot >> $GITHUB_STEP_SUMMARY
size-check:
name: Foundry Size Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node JS
uses: ./.github/actions/setup-nodejs
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# This will run https://book.getfoundry.sh/reference/forge/forge-build#build-options
- name: Run forge build --sizes
run: |
forge build --sizes
working-directory: packages/contracts-core