setup ci #12
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 | |
| - name: Get current commit SHA | |
| id: current-commit | |
| working-directory: erc4626-tests | |
| run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Checkout external project | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ matrix.project.repo }} | |
| path: ${{ matrix.project.dir }} | |
| - name: Replace submodule with current commit | |
| working-directory: ${{ matrix.project.dir }} | |
| run: | | |
| git submodule update --recursive --init | |
| cd ${{ matrix.project.submodule }} | |
| # Add local remote pointing to current erc4626-tests repository | |
| git remote add local ${{ github.workspace }}/erc4626-tests | |
| git remote -v show | |
| git fetch local | |
| git remote update | |
| git branch --all | |
| git checkout ${{ steps.current-commit.outputs.sha }} | |
| - 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 }} |