diff --git a/.github/workflows/bindings_python_ci.yml b/.github/workflows/bindings_python_ci.yml index d8d88bdee2..a1d3e2c175 100644 --- a/.github/workflows/bindings_python_ci.yml +++ b/.github/workflows/bindings_python_ci.yml @@ -86,12 +86,18 @@ jobs: - name: Setup Rust toolchain if: runner.os != 'Linux' uses: ./.github/actions/setup-builder + - name: Get runner image id + if: runner.os != 'Linux' + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" - name: Cache Rust artifacts if: runner.os != 'Linux' uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: - key: bindings-python + key: bindings-python-${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/bindings_python_ci.yml', 'bindings/python/pyproject.toml', 'Cargo.toml') }} save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 with: working-directory: "bindings/python" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9407fea982..1539fdae2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,18 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup-builder + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + + - name: Cache Rust artifacts + uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 + with: + key: ${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/ci.yml', 'Makefile', 'Cargo.toml') }} + save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' + - name: Cargo clippy run: make check-clippy @@ -116,10 +128,19 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup-builder + # The built-in environment hash includes the preinstalled stable + # toolchain, which varies across concurrent image builds. + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + - name: Cache Rust artifacts uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: + key: ${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/ci.yml', 'Makefile', 'Cargo.toml') }} save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - name: Build run: make build @@ -137,10 +158,17 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup-builder + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + - name: Cache Rust artifacts uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: + key: ${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/ci.yml', 'Makefile', 'Cargo.toml') }} save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - name: Check each crate standalone run: | @@ -172,10 +200,17 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup-builder + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + - name: Cache Rust artifacts uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: + key: ${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/ci.yml', 'Makefile', 'Cargo.toml') }} save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - name: Build run: cargo build -p iceberg --no-default-features @@ -201,11 +236,17 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup-builder + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + - name: Cache Rust artifacts uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: - key: ${{ matrix.test-suite.name }} + key: ${{ matrix.test-suite.name }}-${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/ci.yml', 'Makefile', 'Cargo.toml') }} save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - name: Install cargo-nextest if: matrix.test-suite.name == 'default' @@ -253,5 +294,15 @@ jobs: rust-version: ${{ steps.get-msrv.outputs.msrv }} - name: Setup Nightly Rust toolchain uses: ./.github/actions/setup-builder + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + - name: Cache Rust artifacts + uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 + with: + key: msrv-${{ steps.get-msrv.outputs.msrv }}-${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/ci.yml', 'Makefile', 'Cargo.toml') }} + save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - name: Check MSRV run: make check-msrv diff --git a/.github/workflows/public-api.yml b/.github/workflows/public-api.yml index 1c19d5388b..d8a71711fd 100644 --- a/.github/workflows/public-api.yml +++ b/.github/workflows/public-api.yml @@ -43,10 +43,17 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup-builder + - name: Get runner image id + id: image + shell: bash + run: echo "id=${ImageOS:?}" >> "$GITHUB_OUTPUT" + - name: Cache Rust artifacts uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 with: + key: ${{ steps.image.outputs.id }}-${{ hashFiles('.github/workflows/public-api.yml', 'Makefile', 'Cargo.toml') }} save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + add-rust-environment-hash-key: 'false' - name: Check public API run: make check-public-api