From 6b5f5bd0ec3e3a78afb81d86f2daa9c4f28e3665 Mon Sep 17 00:00:00 2001 From: Miles Liu Date: Sat, 19 Nov 2022 14:59:51 +0800 Subject: [PATCH] CI: remove use of actions-rs/toolchain --- .github/workflows/CICD.yml | 109 ++++++++++++--------------------- .github/workflows/FixPR.yml | 18 +++--- .github/workflows/GnuTests.yml | 20 +++--- 3 files changed, 55 insertions(+), 92 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index d080e64fbc3..6926541b9e2 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -65,11 +65,9 @@ jobs: ## note: requires 'nightly' toolchain b/c `cargo-udeps` uses the `rustc` '-Z save-analysis' option ## * ... ref: - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - profile: minimal + run: | + rustup toolchain install nightly --profile minimal + rustup default nightly - uses: Swatinem/rust-cache@v2 - name: Install `cargo-udeps` uses: actions-rs/install@v0.1 @@ -121,12 +119,10 @@ jobs: if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi outputs CARGO_FEATURES_OPTION - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) - components: rustfmt + run: | + rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt} + rustup toolchain install stable -c rustfmt --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`cargo fmt` testing" shell: bash @@ -182,12 +178,9 @@ jobs: macos-latest) brew install coreutils ;; # needed for show-utils.sh esac - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) - components: clippy + run: | + rustup toolchain install stable -c clippy --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`cargo clippy` lint testing" shell: bash @@ -286,12 +279,9 @@ jobs: CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)" outputs CARGO_UTILITY_LIST_OPTIONS - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) - components: clippy + run: | + rustup toolchain install stable -c clippy --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`cargo doc` with warnings" shell: bash @@ -320,11 +310,9 @@ jobs: if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi outputs CARGO_FEATURES_OPTION - name: Install `rust` toolchain (v${{ env.RUST_MIN_SRV }}) - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_MIN_SRV }} - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install ${{ env.RUST_MIN_SRV }} --profile minimal + rustup default ${{ env.RUST_MIN_SRV }} - uses: Swatinem/rust-cache@v2 - name: Confirm MinSRV compatible 'Cargo.lock' shell: bash @@ -375,11 +363,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install stable --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`cargo update` testing" shell: bash @@ -400,11 +386,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install stable --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`make build`" shell: bash @@ -431,11 +415,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install stable --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: Test run: cargo test ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} @@ -455,11 +437,9 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install nightly --profile minimal + rustup default nightly - uses: Swatinem/rust-cache@v2 - name: Test run: cargo test ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} @@ -482,11 +462,9 @@ jobs: sudo apt-get update sudo apt-get install jq - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install stable --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`make install`" shell: bash @@ -670,12 +648,9 @@ jobs: ;; esac - name: rust toolchain ~ install - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_MIN_SRV }} - target: ${{ matrix.job.target }} - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install ${{ env.RUST_MIN_SRV }} -t ${{ matrix.job.target }} --profile minimal + rustup default ${{ env.RUST_MIN_SRV }} - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.job.os }}-${{ matrix.job.target }} @@ -794,11 +769,9 @@ jobs: ## Install/setup prerequisites make prepare-busytest - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install stable --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "Run BusyBox test suite" shell: bash @@ -1003,11 +976,9 @@ jobs: ;; esac - name: rust toolchain ~ install - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ steps.vars.outputs.TOOLCHAIN }} - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install ${{ steps.vars.outputs.TOOLCHAIN }} --profile minimal + rustup default ${{ steps.vars.outputs.TOOLCHAIN }} - uses: Swatinem/rust-cache@v2 - name: Initialize toolchain-dependent workflow variables id: dep_vars diff --git a/.github/workflows/FixPR.yml b/.github/workflows/FixPR.yml index 09cc5900383..f2e9e7bb3ef 100644 --- a/.github/workflows/FixPR.yml +++ b/.github/workflows/FixPR.yml @@ -37,11 +37,9 @@ jobs: RUST_MIN_SRV=$(grep -P "^\s+RUST_MIN_SRV:" .github/workflows/CICD.yml | grep -Po "(?<=\x22)\d+[.]\d+(?:[.]\d+)?(?=\x22)" ) outputs RUST_MIN_SRV - name: Install `rust` toolchain (v${{ steps.vars.outputs.RUST_MIN_SRV }}) - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ steps.vars.outputs.RUST_MIN_SRV }} - default: true - profile: minimal # minimal component installation (ie, no documentation) + run: | + rustup toolchain install ${{ steps.vars.outputs.RUST_MIN_SRV }} --profile minimal + rustup default ${{ steps.vars.outputs.RUST_MIN_SRV }} - uses: Swatinem/rust-cache@v2 - name: Ensure updated 'Cargo.lock' shell: bash @@ -103,12 +101,10 @@ jobs: if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features "${{ matrix.job.features }}"' ; fi outputs CARGO_FEATURES_OPTION - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) - components: rustfmt + run: | + rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt} + rustup toolchain install stable -c rustfmt --profile minimal + rustup default stable - uses: Swatinem/rust-cache@v2 - name: "`cargo fmt`" shell: bash diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 66718149e51..ac47c0dc27d 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -66,12 +66,10 @@ jobs: workflow_conclusion: completed ## continually recalibrates to last commit of default branch with a successful GnuTests (ie, "self-heals" from GnuTest regressions, but needs more supervision for/of regressions) path: "${{ steps.vars.outputs.path_reference }}" - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - profile: minimal # minimal component installation (ie, no documentation) - components: rustfmt + run: | + rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt} + rustup toolchain install stable -c rustfmt --profile minimal + rustup default stable - name: Install dependencies shell: bash run: | @@ -281,12 +279,10 @@ jobs: ref: 'v9.1' submodules: recursive - name: Install `rust` toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - default: true - profile: minimal # minimal component installation (ie, no documentation) - components: rustfmt + run: | + rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt} + rustup toolchain install nightly -c rustfmt --profile minimal + rustup default nightly - name: Install dependencies run: | sudo apt update