-
Notifications
You must be signed in to change notification settings - Fork 13
58 lines (47 loc) · 1.44 KB
/
forge.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
name: forge-tests
on:
push:
branches: [ 'main' ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ '**' ]
paths-ignore:
- 'README.md'
workflow_dispatch:
jobs:
forge-tests:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [18.15.x]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Install dependencies
run: yarn install --production=false
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
- name: "Show the Foundry config"
run: "forge config"
- name: "Generate a fuzz seed that changes weekly to avoid burning through RPC allowance"
run: >
echo "FOUNDRY_FUZZ_SEED=$(
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800))
)" >> $GITHUB_ENV
- name: clean
run: yarn clean
- name: "Run the tests"
run: |
cd ./packages/contracts
forge build
forge test
- name: "Add test summary"
run: |
echo "## Tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY