-
Notifications
You must be signed in to change notification settings - Fork 41
83 lines (66 loc) · 2.32 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
75
76
77
78
79
80
81
82
83
name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- main
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
with:
node-version-file: .nvmrc
cache: "npm"
- name: install
run: npm ci --prefer-offline --no-audit
- name: lint
run: npm run lint
test:
name: Foundry build n test
runs-on: ubuntu-latest
env:
FOUNDRY_PROFILE: ci
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6
with:
node-version-file: .nvmrc
cache: "npm"
- name: Install node dependencies
run: npm ci --prefer-offline --no-audit
- name: Run Foundry setup
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@d738561b5afce35ca3752b28236c9dd68a3fa822
- name: Run Forge tests
uses: bgd-labs/github-workflows/.github/actions/foundry-test@d738561b5afce35ca3752b28236c9dd68a3fa822
- name: Run Gas report
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@d738561b5afce35ca3752b28236c9dd68a3fa822
- name: Cleanup
# This test will currently fail on coverage due to the gas limit beaing breached with optimizer disabled
run: rm tests/deployments/DeploymentsGasLimits.t.sol
- name: Run Lcov report
uses: bgd-labs/github-workflows/.github/actions/foundry-lcov-report@d738561b5afce35ca3752b28236c9dd68a3fa822
- name: Save PR number
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
env:
PR_NUMBER: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo $PR_NUMBER > /tmp/content/pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: content
path: /tmp/content
# we let failing tests pass so we can log them in the comment, still we want the ci to fail
- name: Post test
if: ${{ env.testStatus != 0 }}
run: |
echo "tests failed"
exit 1