Skip to content

Commit 14b7804

Browse files
committed
setup ci
1 parent 232ff9b commit 14b7804

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
project:
18+
- repo: "OpenZeppelin/openzeppelin-contracts"
19+
dir: "openzeppelin-contracts"
20+
submodule: "lib/erc4626-tests"
21+
cmd: "forge test --mc ERC4626StdTest"
22+
23+
steps:
24+
- name: Checkout current repository
25+
uses: actions/checkout@v4
26+
with:
27+
path: erc4626-tests
28+
29+
- name: Checkout external project
30+
uses: actions/checkout@v4
31+
with:
32+
repository: ${{ matrix.project.repo }}
33+
path: ${{ matrix.project.dir }}
34+
submodules: recursive
35+
36+
- name: Replace submodule with current repository
37+
working-directory: ${{ matrix.project.dir }}
38+
run: |
39+
rm -rf ${{ matrix.project.submodule }}
40+
cp -r ${{ github.workspace }}/erc4626-tests ${{ matrix.project.submodule }}
41+
42+
- name: Install Foundry
43+
uses: foundry-rs/foundry-toolchain@v1
44+
with:
45+
version: nightly
46+
47+
- name: Run tests
48+
working-directory: ${{ matrix.project.dir }}
49+
run: |
50+
${{ matrix.project.cmd }}

0 commit comments

Comments
 (0)