-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (56 loc) · 1.74 KB
/
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
name: Run Forge Tests
on: [pull_request]
jobs:
bootstrap:
name: Bootstrap environment
runs-on: ubuntu-latest
outputs:
cache-path: ${{ steps.cache.outputs.path }}
cache-key: ${{ steps.cache.outputs.key }}
env:
FORGE_REV: 03ea54c
steps:
- name: Build cache params
id: cache
run: |
echo "path=$CACHE_PATH" >> "$GITHUB_OUTPUT"
echo "$KEY_INPUT" | md5sum | awk '{print $1}' | xargs -I% echo "key=cargobin-%-${RUNNER_OS}" >> "$GITHUB_OUTPUT"
env:
CACHE_PATH: |
~/.cargo/bin/
KEY_INPUT: |
forge:${{env.FORGE_REV}}
- uses: actions/cache@v4
id: get-cache
with:
path: ${{ steps.cache.outputs.path }}
key: ${{ steps.cache.outputs.key }}
- name: Install forge & anvil
run: cargo install --git https://github.com/foundry-rs/foundry --rev "$FORGE_REV" --profile release --locked forge anvil
if: steps.get-cache.outputs.cache-hit != 'true'
foundry:
name: Foundry tests
runs-on: ubuntu-latest
needs: bootstrap
env:
FORGE_REV: 03ea54c
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/cache@v4
with:
path: ${{ needs.bootstrap.outputs.cache-path }}
key: ${{ needs.bootstrap.outputs.cache-key }}
- name: Install node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
cache-dependency-path: "**/yarn.lock"
- name: Build
run: forge build --sizes
- name: Run local integration tests
run: forge test
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}