-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (47 loc) · 1.38 KB
/
test.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
name: test
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
env:
FOUNDRY_PROFILE: ci
jobs:
forge-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Restore cached node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: |
./node_modules
./packages/node_modules
key: ${{ runner.os }}-${{ steps.nvm.outputs.NVMRC }}-nodemodules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ steps.nvm.outputs.NVMRC }}-nodemodules-
- name: Install Foundry
uses: onbjerg/foundry-toolchain@v1
with:
version: nightly
- name: Install JS dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install --frozen-lockfile --prefer-offline
- name: Check contract sizes
run: forge build --sizes
- name: Run tests
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
run: forge test --force --optimize -vvv --gas-price 1000
- name: Check gas snapshots
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
run: forge snapshot --check