Skip to content

setup ci

setup ci #14

Workflow file for this run

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
rm -rf ${{ matrix.project.submodule }}
cp -r ${{ github.workspace }}/erc4626-tests ${{ matrix.project.submodule }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run tests
working-directory: ${{ matrix.project.dir }}
run: |
${{ matrix.project.cmd }}