From 7f59978a0aeddaff52a3d1f0550f3eadddb11c8f Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Tue, 12 Nov 2024 10:26:42 +0100 Subject: [PATCH] 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. --- .github/workflows/build.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ef14eb5..b5b8ce6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,12 +52,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup Rust cache - uses: ./.github/workflows/setup-rust-cache - - name: Update Rust run: rustup update + - name: Setup Rust cache + uses: ./.github/workflows/setup-rust-cache + - name: Build Rust code run: cargo build @@ -83,6 +83,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Install toolchain + run: | + rustup update + rustup target add ${{ matrix.target }} + - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache @@ -91,11 +96,6 @@ jobs: sudo apt update sudo apt install gcc-aarch64-linux-gnu - - name: Install toolchain - run: | - rustup update - rustup target add ${{ matrix.target }} - - name: Build Rust code working-directory: ${{ matrix.directory }} run: cargo build @@ -135,6 +135,9 @@ jobs: with: fetch-depth: 0 # We need the full history for build.sh below. + - name: Update Rust + run: rustup update + - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache with: @@ -145,9 +148,6 @@ jobs: sudo apt update sudo apt install gettext - - name: Update Rust - run: rustup update - - name: Install mdbook uses: ./.github/workflows/install-mdbook