diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 01f2479b..044bc6cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,14 +2,44 @@ name: Run Forge Tests on: [push, pull_request] jobs: + bootstrap: + name: Bootstrap environment + runs-on: ubuntu-latest + outputs: + cache-path: ${{ steps.cache.outputs.path }} + cache-key: ${{ steps.cache.outputs.key }} + steps: + - name: Build cache params + id: cache + run: | + echo "path=$CACHE_PATH" >> "$GITHUB_OUTPUT" + echo "$KEY_INPUT" | md5sum | awk '{print $1}' | xargs -I% echo "key=cargobin-%-${RUNNER_OS}" >> "$GITHUB_OUTPUT" + env: + CACHE_PATH: | + ~/.cargo/bin/ + KEY_INPUT: | + forge:${{env.FORGE_REV}} + + - uses: actions/cache@v4 + id: get-cache + with: + path: ${{ steps.cache.outputs.path }} + key: ${{ steps.cache.outputs.key }} + foundry: name: Foundry tests runs-on: ubuntu-latest + env: + FORGE_REV: 03ea54c steps: - uses: actions/checkout@v4 with: persist-credentials: false + - name: Install forge & anvil + run: cargo install --git https://github.com/foundry-rs/foundry --rev "$FORGE_REV" --profile release --locked forge anvil + if: steps.get-cache.outputs.cache-hit != 'true' + - name: Install node uses: actions/setup-node@v4 with: