about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-04-16 08:52:22 +0200
committerJakub Beránek <berykubik@gmail.com>2025-04-16 08:58:25 +0200
commita2875d50e778c89047d376a75f8f567708ecea6a (patch)
treee4e9d075a82ba5b3813f58d38f94838549e084e8
parent7104efa579cbd2fd7656f9d3888afbc2942f9902 (diff)
downloadrust-a2875d50e778c89047d376a75f8f567708ecea6a.tar.gz
rust-a2875d50e778c89047d376a75f8f567708ecea6a.zip
Pin rustc used for the `proc-macro-src` CI job
-rw-r--r--src/tools/rust-analyzer/.github/workflows/ci.yaml18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/tools/rust-analyzer/.github/workflows/ci.yaml b/src/tools/rust-analyzer/.github/workflows/ci.yaml
index 84524201c37..79fb7a2d2ea 100644
--- a/src/tools/rust-analyzer/.github/workflows/ci.yaml
+++ b/src/tools/rust-analyzer/.github/workflows/ci.yaml
@@ -46,17 +46,25 @@ jobs:
         with:
           ref: ${{ github.event.pull_request.head.sha }}
 
+      - name: Install rustup-toolchain-install-master
+        run: cargo install rustup-toolchain-install-master@1.6.0
+
+      # Install a pinned rustc commit to avoid surprises
       - name: Install Rust toolchain
         run: |
-          rustup update --no-self-update nightly
-          rustup default nightly
-          rustup component add --toolchain nightly rust-src rustfmt
+          RUSTC_VERSION=`cat rust-version`
+          rustup-toolchain-install-master ${RUSTC_VERSION} -c rust-src -c rustfmt
+          rustup default ${RUSTC_VERSION}
+
+      # Emulate a nightly toolchain, because the toolchain installed above does not have "nightly"
+      # in its version string.
+      - name: Emulate a nightly toolchain
+        run: echo "RUSTC_BOOTSTRAP=1" >> $GITHUB_ENV
+
       # https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
       - name: Install Rust Problem Matcher
         run: echo "::add-matcher::.github/rust.json"
 
-      # We don't cache this job, as it will be invalidated every day due to nightly usage
-
       - name: Test
         run: cargo test --features sysroot-abi -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet