Setup Rust after restoring the cache (#5892)

This saves about 10-20s

Part of #5713
This commit is contained in:
Zanie Blue 2024-08-07 16:33:12 -05:00 committed by GitHub
parent c681c5a33c
commit 7523673f39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 23 deletions

View File

@ -90,11 +90,11 @@ jobs:
name: "cargo clippy | ubuntu"
steps:
- uses: actions/checkout@v4
- name: "Install Rust toolchain"
run: rustup component add clippy
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: "Install Rust toolchain"
run: rustup component add clippy
- name: "Clippy"
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
@ -105,8 +105,6 @@ jobs:
name: "cargo clippy | windows"
steps:
- uses: actions/checkout@v4
- name: "Install Rust toolchain"
run: rustup target add x86_64-pc-windows-msvc
- name: Load xwin cache
uses: actions/cache@v4
with:
@ -116,6 +114,8 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: "Install Rust toolchain"
run: rustup target add x86_64-pc-windows-msvc
- name: "Install cargo-xwin"
uses: taiki-e/install-action@v2
with:
@ -149,13 +149,14 @@ jobs:
name: "cargo test | ubuntu"
steps:
- uses: actions/checkout@v4
- name: "Install Rust toolchain"
run: rustup show
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- name: "Install Rust toolchain"
run: rustup show
- name: "Install required Python versions"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
@ -187,13 +188,14 @@ jobs:
name: "cargo test | macos"
steps:
- uses: actions/checkout@v4
- name: "Install Rust toolchain"
run: rustup show
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- name: "Install Rust toolchain"
run: rustup show
- name: "Install required Python versions"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
@ -241,13 +243,6 @@ jobs:
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.DEV_DRIVE }}/uv" -Recurse
- name: "Install Rust toolchain"
working-directory: ${{ env.DEV_DRIVE }}/uv
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
run: rustup show
# We do not test with Python patch versions on Windows
# so we can use `setup-python` instead of our bootstrapping code
# this is much faster on the extremely slow GitHub Windows runners.
@ -267,6 +262,13 @@ jobs:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
- name: "Install Rust toolchain"
working-directory: ${{ env.DEV_DRIVE }}/uv
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
run: rustup show
- name: "Install cargo nextest"
uses: taiki-e/install-action@v2
with:
@ -308,12 +310,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: "Install Rust toolchain"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
run: |
rustup target add ${{ matrix.target-arch }}-pc-windows-msvc
rustup component add rust-src --target ${{ matrix.target-arch }}-pc-windows-msvc
- name: Load xwin cache
uses: actions/cache@v4
with:
@ -326,6 +322,12 @@ jobs:
with:
workspaces: ${{ github.workspace }}/crates/uv-trampoline
- name: "Install Rust toolchain"
working-directory: ${{ github.workspace }}/crates/uv-trampoline
run: |
rustup target add ${{ matrix.target-arch }}-pc-windows-msvc
rustup component add rust-src --target ${{ matrix.target-arch }}-pc-windows-msvc
- name: "Install cargo-xwin and cargo-bloat"
uses: taiki-e/install-action@v2
with:
@ -1477,6 +1479,8 @@ jobs:
- name: "Checkout Branch"
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: "Install Rust toolchain"
run: rustup show
@ -1485,8 +1489,6 @@ jobs:
with:
tool: cargo-codspeed
- uses: Swatinem/rust-cache@v2
- name: "Install requirements and prime cache"
run: |
sudo apt-get update