diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 137c973..bd0f801 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -6,8 +6,25 @@ on: pull_request: jobs: + # Discover all strategies in the project + strategy-list: + name: Strategy list + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v2 + - id: set-matrix + run: echo "matrix=$(ls ./crates/strategies | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT" + + # Matrix across all discovered strategies tests: runs-on: ubuntu-latest + needs: [strategy-list] + strategy: + fail-fast: false + matrix: + target: ${{ fromJson(needs.strategy-list.outputs.matrix) }} env: ETH_MAINNET_HTTP: https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf steps: @@ -21,6 +38,5 @@ jobs: - name: Foundry version run: forge --version - # We need to run tests for every strategy independently - - name: Run Opensea Sudo Arb tests - run: forge test --root ./crates/strategies/opensea-sudo-arb/contracts + - name: Run ${{ matrix.target }} tests + run: forge test --root ./crates/strategies/${{ matrix.target }}/contracts diff --git a/.gitignore b/.gitignore index 7a8469f..9613d14 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ monitoring/grafana/data/ # Dotenv file .env + +.idea/