diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index c4c116e6..4e640fa3 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -111,7 +111,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: # Update this key to force a new cache (but share with the python.yml workflow) - prefix-key: "python-v1" + prefix-key: "python-v2" - name: Install docs requirements run: | diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 441d7b07..2232cc87 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -60,7 +60,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: # Update this key to force a new cache - prefix-key: "python-wheel-windows-latest-v1" + prefix-key: "python-wheel-windows-latest-v2" - name: Clone vcpkg uses: actions/checkout@v4 @@ -117,7 +117,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: # Update this key to force a new cache - prefix-key: "python-wheel-macOS-latest-v1" + prefix-key: "python-wheel-macOS-latest-v2" - name: Clone vcpkg uses: actions/checkout@v4 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 2f447b5f..fd242e54 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -92,7 +92,7 @@ jobs: with: path: vcpkg/packages # Bump the number at the end of this line to force a new dependency build - key: vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-1 + key: vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-2 - name: Install vcpkg dependencies if: steps.cache-vcpkg.outputs.cache-hit != 'true' @@ -112,7 +112,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: # Update this key to force a new cache (sync with packaging.yml) - prefix-key: "python-v1" + prefix-key: "python-v2" - name: Install run: | diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 2a384e6d..151809b7 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -61,16 +61,19 @@ jobs: use-public-rspm: true - name: Use stable Rust - id: rust + if: matrix.config.os != 'windows-latest' run: | rustup toolchain install stable --no-self-update rustup default stable - # GHA runner installs GNU target by default, but --no-self-update might - # remove it, so run `target add` to ensure the GNU target installed. - - name: Setup Rust (Windows) + # Set the default toolchain here so that rust-cache saves/restores + # the correct target. (The R package will use this target regardless, + # this just in theory helps the cache) + - name: Use stable Rust (windows) if: matrix.config.os == 'windows-latest' - run: rustup target add x86_64-pc-windows-gnu + run: | + rustup toolchain install stable-x86_64-pc-windows-gnu --no-self-update + rustup default stable-x86_64-pc-windows-gnu - name: Install dependencies (Linux) if: matrix.config.os == 'ubuntu-latest' @@ -83,7 +86,18 @@ jobs: - uses: Swatinem/rust-cache@v2 with: # Update this key to force a new cache - prefix-key: "r-v2" + prefix-key: "r-v3" + # The R package uses its own target directory + workspaces: ". -> r/sedonadb/src/rust/target" + + # Explicitly specify for Windows, which otherwise chooses a shorter version + # to work around a path length limitation when building from longer starting paths. + # This allows us to use a common cache configuration for Windows, MacOS, and Linux + - name: Set R/Rust target directory + if: matrix.config.os == 'windows-latest' + run: | + echo "SEDONADB_TARGET_DIR=$(pwd -W)/r/sedonadb/src/rust/target" >> $GITHUB_ENV + shell: bash - uses: r-lib/actions/setup-r-dependencies@v2 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f7ea8d1b..60959114 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -91,7 +91,7 @@ jobs: with: path: vcpkg/packages # Bump the number at the end of this line to force a new dependency build - key: vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-1 + key: vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-2 - name: Install vcpkg dependencies if: steps.cache-vcpkg.outputs.cache-hit != 'true' @@ -106,10 +106,11 @@ jobs: run: | rustup toolchain install stable --no-self-update rustup default stable + - uses: Swatinem/rust-cache@v2 with: # Update this key to force a new cache - prefix-key: "rust-${{ matrix.name }}-v3" + prefix-key: "rust-${{ matrix.name }}-v4" - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main