-
Notifications
You must be signed in to change notification settings - Fork 35
74 lines (66 loc) · 1.73 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Test
on:
workflow_dispatch:
pull_request:
paths:
- '**.sol'
- '**.yml'
- '**.toml'
- 'lib/**'
- '.gitmodules'
push:
branches:
- main
paths:
- '**.sol'
- '**.yml'
- '**.toml'
- 'lib/**'
- '.gitmodules'
env:
FOUNDRY_PROFILE: ci
jobs:
test:
strategy:
fail-fast: true
matrix:
profile: [solc-0.7.6,default]
name: Foundry project
runs-on: ubuntu-latest
env:
# should support archive requests
FORK_URL: 'https://eth.llamarpc.com'
FORK_BLOCK_NUMBER: 20691292
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
- id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- run: yarn --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run Forge build with ${{ matrix.profile }}
# We always build with 0.7.6 to ensure that the project is compatible with the oldest version
run: |
forge --version
if [ "${{ matrix.profile }}" == "solc-0.7.6" ]; then
FOUNDRY_PROFILE=ci forge build --sizes --use 0.7.6 --skip 'test/*' --skip 'script/*'
else
FOUNDRY_PROFILE=ci forge build --sizes
fi
id: build
- name: Run Forge tests
if: matrix.profile != 'solc-0.7.6'
run: |
FOUNDRY_PROFILE=ci forge test -vvv
id: test