Skip to content

Commit 7f59978

Browse files
authored
Update Rust before setting up the cache (#2460)
The cache is keyed on the Rust version used, so we should update Rust before setting up the cache. This is a small update to #2449.
1 parent b4f07ba commit 7f59978

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ jobs:
5252
- name: Checkout
5353
uses: actions/checkout@v4
5454

55-
- name: Setup Rust cache
56-
uses: ./.github/workflows/setup-rust-cache
57-
5855
- name: Update Rust
5956
run: rustup update
6057

58+
- name: Setup Rust cache
59+
uses: ./.github/workflows/setup-rust-cache
60+
6161
- name: Build Rust code
6262
run: cargo build
6363

@@ -83,6 +83,11 @@ jobs:
8383
- name: Checkout
8484
uses: actions/checkout@v4
8585

86+
- name: Install toolchain
87+
run: |
88+
rustup update
89+
rustup target add ${{ matrix.target }}
90+
8691
- name: Setup Rust cache
8792
uses: ./.github/workflows/setup-rust-cache
8893

@@ -91,11 +96,6 @@ jobs:
9196
sudo apt update
9297
sudo apt install gcc-aarch64-linux-gnu
9398
94-
- name: Install toolchain
95-
run: |
96-
rustup update
97-
rustup target add ${{ matrix.target }}
98-
9999
- name: Build Rust code
100100
working-directory: ${{ matrix.directory }}
101101
run: cargo build
@@ -135,6 +135,9 @@ jobs:
135135
with:
136136
fetch-depth: 0 # We need the full history for build.sh below.
137137

138+
- name: Update Rust
139+
run: rustup update
140+
138141
- name: Setup Rust cache
139142
uses: ./.github/workflows/setup-rust-cache
140143
with:
@@ -145,9 +148,6 @@ jobs:
145148
sudo apt update
146149
sudo apt install gettext
147150
148-
- name: Update Rust
149-
run: rustup update
150-
151151
- name: Install mdbook
152152
uses: ./.github/workflows/install-mdbook
153153

0 commit comments

Comments
 (0)