diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-01-04 21:32:14 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2025-01-04 23:12:32 +0100 |
| commit | 12d31375601b592c5451dd52de4633393229a9a2 (patch) | |
| tree | caba583115dc43eecfc5547c15abcbc37645188b | |
| parent | 7a01033797b4a479335b5432204e4ae6fc3a562c (diff) | |
| download | rust-12d31375601b592c5451dd52de4633393229a9a2.tar.gz rust-12d31375601b592c5451dd52de4633393229a9a2.zip | |
CI: be compatible with both Rustup pre-1.28.0 and 1.28.0
`rustup show active-toolchain` will no longer install the default toolchain starting from Rustup 1.28.0, and `rustup toolchain install` without extra arguments is not supported in Rustup pre-1.28.0.
| -rw-r--r-- | .github/workflows/clippy_mq.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/clippy_pr.yml | 4 |
2 files changed, 15 insertions, 6 deletions
diff --git a/.github/workflows/clippy_mq.yml b/.github/workflows/clippy_mq.yml index 078a278e21a..dee7d028655 100644 --- a/.github/workflows/clippy_mq.yml +++ b/.github/workflows/clippy_mq.yml @@ -78,7 +78,8 @@ jobs: - name: Install toolchain run: | rustup set default-host ${{ matrix.host }} - rustup show active-toolchain + # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0 + rustup show active-toolchain || rustup toolchain install # Run - name: Build @@ -129,7 +130,9 @@ jobs: persist-credentials: false - name: Install toolchain - run: rustup show active-toolchain + run: | + # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0 + rustup show active-toolchain || rustup toolchain install - name: Test metadata collection run: cargo collect-metadata @@ -146,7 +149,9 @@ jobs: persist-credentials: false - name: Install toolchain - run: rustup show active-toolchain + run: | + # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0 + rustup show active-toolchain || rustup toolchain install # Run - name: Build Integration Test @@ -200,7 +205,9 @@ jobs: persist-credentials: false - name: Install toolchain - run: rustup show active-toolchain + run: | + # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0 + rustup show active-toolchain || rustup toolchain install # Download - name: Download target dir @@ -215,7 +222,7 @@ jobs: # Run - name: Test ${{ matrix.integration }} run: | - TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ') + TOOLCHAIN=$(rustup show active-toolchain | head -n 1 | cut -f1 -d' ') rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output env: INTEGRATION: ${{ matrix.integration }} diff --git a/.github/workflows/clippy_pr.yml b/.github/workflows/clippy_pr.yml index 9e7adc2a5c3..80523d91f4f 100644 --- a/.github/workflows/clippy_pr.yml +++ b/.github/workflows/clippy_pr.yml @@ -30,7 +30,9 @@ jobs: persist-credentials: false - name: Install toolchain - run: rustup show active-toolchain + run: | + # Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0 + rustup show active-toolchain || rustup toolchain install # Run - name: Build |
