1+ # This action runs all common tooling for foundry repos
2+ # It does not comment any results though.
3+ # If you want to have comments on your repo, also install comment.yml
14name : Test
25
36concurrency :
@@ -7,77 +10,13 @@ concurrency:
710on :
811 pull_request :
912 push :
10- branches :
11- - main
13+ branches : [main]
1214
1315jobs :
1416 lint :
15- name : lint
16- runs-on : ubuntu-latest
17- steps :
18- - uses : actions/checkout@v4
19-
20- - uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
21- with :
22- node-version-file : .nvmrc
23- cache : " npm"
24-
25- - name : install
26- run : npm ci --prefer-offline --no-audit
27-
28- - name : lint
29- run : npm run lint
30-
17+ uses : bgd-labs/github-workflows/.github/workflows/foundry-lint-prettier.yml@main
3118 test :
32- name : Foundry build n test
33- runs-on : ubuntu-latest
34- env :
35- FOUNDRY_PROFILE : ci
36- steps :
37- - uses : actions/checkout@v4
38- with :
39- submodules : recursive
40-
41- - uses : actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
42- with :
43- node-version-file : .nvmrc
44- cache : " npm"
45-
46- - name : Install node dependencies
47- run : npm ci --prefer-offline --no-audit
48-
49- - name : Run Foundry setup
50- uses : bgd-labs/github-workflows/.github/actions/foundry-setup@4f16d15e380bbcf7e3933698c08b9fd34e967f78
51-
52- - name : Run Forge tests
53- uses : bgd-labs/github-workflows/.github/actions/foundry-test@4f16d15e380bbcf7e3933698c08b9fd34e967f78
54-
55- - name : Run Gas report
56- uses : bgd-labs/github-workflows/.github/actions/foundry-gas-report@4f16d15e380bbcf7e3933698c08b9fd34e967f78
57-
58- - name : Cleanup
59- # This test will currently fail on coverage due to the gas limit beaing breached with optimizer disabled
60- run : rm tests/deployments/DeploymentsGasLimits.t.sol
61-
62- - name : Run Lcov report
63- uses : bgd-labs/github-workflows/.github/actions/foundry-lcov-report@4f16d15e380bbcf7e3933698c08b9fd34e967f78
64-
65- - name : Save PR number
66- if : github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
67- env :
68- PR_NUMBER : ${{ github.event.number }}
69- run : |
70- mkdir -p ./pr
71- echo $PR_NUMBER > /tmp/content/pr_number.txt
72-
73- - uses : actions/upload-artifact@v4
74- with :
75- name : content
76- path : /tmp/content
77-
78- # we let failing tests pass so we can log them in the comment, still we want the ci to fail
79- - name : Post test
80- if : ${{ env.testStatus != 0 }}
81- run : |
82- echo "tests failed"
83- exit 1
19+ uses : bgd-labs/github-workflows/.github/workflows/foundry-test.yml@main
20+ # only when the repo has zksync code
21+ # test-zk:
22+ # uses: bgd-labs/github-workflows/.github/workflows/foundry-test-zk.yml@main
0 commit comments