From 0c837337928075e33d3f6aac3b23c6d6c44a0f4e Mon Sep 17 00:00:00 2001 From: Jonathan Cubides Date: Thu, 2 Jul 2026 21:34:20 -0500 Subject: [PATCH] ci(bindings): cache rust build and retry flaky tests Replace the hand-rolled actions/cache with Swatinem/rust-cache@v2 at the default workspace root. This is a Cargo workspace, so the build output lives in the root `target/`; Swatinem caches that plus `~/.cargo` (registry + git), keyed on Cargo.lock and the toolchain. The bindings tests fork live chain RPCs via anvil and flake on transient RPC timeouts, so the test step retries up to 3 times. --- .github/workflows/bindings.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 56226c4e..072190df 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -35,13 +35,8 @@ jobs: - name: Show Foundry version run: forge --version - - name: Restore dependencies cache - uses: actions/cache@v4 - with: - path: | - target - key: rust-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: rust- + - name: Rust cache + uses: Swatinem/rust-cache@v2 - name: Run rustfmt run: just bindings-fmt-check @@ -52,5 +47,11 @@ jobs: - name: Lint Bindings run: just bindings-lint + # bindings tests fork live RPCs via anvil; retry to absorb transient timeouts. - name: Run Tests - run: just bindings-test + run: | + for i in 1 2 3; do + just bindings-test && exit 0 + [ "$i" -lt 3 ] && { echo "attempt $i failed, retrying in 10s"; sleep 10; } + done + exit 1