Skip to content

Commit

Permalink
Setup Rust after restoring the cache (#5892)
Browse files Browse the repository at this point in the history
This saves about 10-20s

Part of #5713
  • Loading branch information
zanieb authored Aug 7, 2024
1 parent c681c5a commit 7523673
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -1477,6 +1479,8 @@ jobs:
- name: "Checkout Branch"
uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

- name: "Install Rust toolchain"
run: rustup show

Expand All @@ -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
Expand Down

0 comments on commit 7523673

Please sign in to comment.