Skip to content

Commit 2e57429

Browse files
authored
feat: use shared workflow (#194)
1 parent 3dfea9e commit 2e57429

File tree

3 files changed

+12
-148
lines changed

3 files changed

+12
-148
lines changed

.github/workflows/comment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: PR Comment
22

33
on:
44
workflow_run:
5+
# The workflow generating the artifacts
56
workflows: [Test]
67
types:
78
- completed
@@ -12,10 +13,11 @@ permissions:
1213
checks: read
1314
statuses: read
1415
pull-requests: write
15-
contents: write
1616

1717
jobs:
1818
comment:
1919
uses: bgd-labs/github-workflows/.github/workflows/comment.yml@main
2020
secrets:
21+
# the provided PAT needs write and write permissions on issues and pull requests
22+
# the PAT is only really needed when commenting of prs from forks
2123
READ_ONLY_PAT: ${{ secrets.READ_ONLY_PAT }}

.github/workflows/test.yml

Lines changed: 9 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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
14
name: Test
25

36
concurrency:
@@ -7,78 +10,13 @@ concurrency:
710
on:
811
pull_request:
912
push:
10-
branches:
11-
- main
13+
branches: [main]
1214

1315
jobs:
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@9ab528d7b505e74caf4e485d175fc0cc9ac1e9fb
51-
52-
- name: Run Forge tests
53-
uses: bgd-labs/github-workflows/.github/actions/foundry-test@9ab528d7b505e74caf4e485d175fc0cc9ac1e9fb
54-
55-
- name: Run Gas report
56-
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@9ab528d7b505e74caf4e485d175fc0cc9ac1e9fb
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@9ab528d7b505e74caf4e485d175fc0cc9ac1e9fb
64-
65-
- name: Save PR number
66-
if: always() && (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-
if: always()
75-
with:
76-
name: content
77-
path: /tmp/content
78-
79-
# we let failing tests pass so we can log them in the comment, still we want the ci to fail
80-
- name: Post test
81-
if: ${{ env.testStatus != 0 }}
82-
run: |
83-
echo "tests failed"
84-
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

tests/deployments/DeploymentsGasLimits.t.sol

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -198,80 +198,4 @@ contract DeploymentsGasLimits is BatchTestProcedures {
198198
address(aaveV3SetupOne)
199199
);
200200
}
201-
202-
function testCheckInitCodeSizeBatchs() public pure {
203-
uint16 maxInitCodeSize = 49152;
204-
205-
console.log('AaveV3SetupBatch', type(AaveV3SetupBatch).creationCode.length);
206-
console.log('AaveV3L2PoolBatch', type(AaveV3L2PoolBatch).creationCode.length);
207-
console.log('AaveV3PoolBatch', type(AaveV3PoolBatch).creationCode.length);
208-
console.log('AaveV3PeripheryBatch', type(AaveV3PeripheryBatch).creationCode.length);
209-
console.log('AaveV3MiscBatch', type(AaveV3MiscBatch).creationCode.length);
210-
console.log('AaveV3ParaswapBatch', type(AaveV3ParaswapBatch).creationCode.length);
211-
console.log('AaveV3GettersBatchOne', type(AaveV3GettersBatchOne).creationCode.length);
212-
console.log('AaveV3GettersBatchTwo', type(AaveV3GettersBatchTwo).creationCode.length);
213-
console.log('AaveV3TokensBatch', type(AaveV3TokensBatch).creationCode.length);
214-
console.log('AaveV3HelpersBatchOne', type(AaveV3HelpersBatchOne).creationCode.length);
215-
console.log('AaveV3HelpersBatchTwo', type(AaveV3HelpersBatchTwo).creationCode.length);
216-
console.log(
217-
'AaveV3PeripheryBatchTreasuryPartner',
218-
type(AaveV3PeripheryBatch).creationCode.length
219-
);
220-
221-
assertLe(
222-
type(AaveV3SetupBatch).creationCode.length,
223-
maxInitCodeSize,
224-
'AaveV3SetupBatch max init code size'
225-
);
226-
assertLe(
227-
type(AaveV3L2PoolBatch).creationCode.length,
228-
maxInitCodeSize,
229-
'AaveV3L2PoolBatch max init code size'
230-
);
231-
assertLe(
232-
type(AaveV3PoolBatch).creationCode.length,
233-
maxInitCodeSize,
234-
'AaveV3PoolBatch max init code size'
235-
);
236-
assertLe(
237-
type(AaveV3PeripheryBatch).creationCode.length,
238-
maxInitCodeSize,
239-
'AaveV3PeripheryBatch max init code size'
240-
);
241-
assertLe(
242-
type(AaveV3MiscBatch).creationCode.length,
243-
maxInitCodeSize,
244-
'AaveV3MiscBatch max init code size'
245-
);
246-
assertLe(
247-
type(AaveV3ParaswapBatch).creationCode.length,
248-
maxInitCodeSize,
249-
'AaveV3ParaswapBatch max init code size'
250-
);
251-
assertLe(
252-
type(AaveV3GettersBatchOne).creationCode.length,
253-
maxInitCodeSize,
254-
'AaveV3GettersBatchOne max init code size'
255-
);
256-
assertLe(
257-
type(AaveV3GettersBatchTwo).creationCode.length,
258-
maxInitCodeSize,
259-
'AaveV3GettersBatchTwo max init code size'
260-
);
261-
assertLe(
262-
type(AaveV3TokensBatch).creationCode.length,
263-
maxInitCodeSize,
264-
'AaveV3TokensBatch max init code size'
265-
);
266-
assertLe(
267-
type(AaveV3HelpersBatchOne).creationCode.length,
268-
maxInitCodeSize,
269-
'AaveV3HelpersBatchOne max init code size'
270-
);
271-
assertLe(
272-
type(AaveV3HelpersBatchTwo).creationCode.length,
273-
maxInitCodeSize,
274-
'AaveV3HelpersBatchTwo max init code size'
275-
);
276-
}
277201
}

0 commit comments

Comments
 (0)