setup ci #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: | |
| - repo: "OpenZeppelin/openzeppelin-contracts" | |
| dir: "openzeppelin-contracts" | |
| submodule: "lib/erc4626-tests" | |
| cmd: "forge test --mc ERC4626StdTest" | |
| steps: | |
| - name: Checkout current repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: erc4626-tests | |
| fetch-depth: 0 | |
| - name: Checkout external project | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ matrix.project.repo }} | |
| path: ${{ matrix.project.dir }} | |
| submodules: recursive | |
| - name: Replace submodule with current commit | |
| working-directory: ${{ matrix.project.dir }} | |
| run: | | |
| cd ${{ matrix.project.submodule }} | |
| # Add local remote pointing to current erc4626-tests repository | |
| git remote add local ${{ github.workspace }}/erc4626-tests | |
| git fetch local | |
| git checkout local/HEAD | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: nightly | |
| - name: Run tests | |
| working-directory: ${{ matrix.project.dir }} | |
| run: | | |
| ${{ matrix.project.test_command }} |