From dcbcbc424ca9d9502dc8674f07edb0842a84e3f1 Mon Sep 17 00:00:00 2001 From: hrmny <8845940+ForsakenHarmony@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:31:48 +0200 Subject: [PATCH] update toolchain definition and swap action --- .github/actions/setup-rust/action.yml | 54 +++----------------------- .github/workflows/build_and_deploy.yml | 2 +- .github/workflows/build_reusable.yml | 2 - rust-toolchain | 1 - rust-toolchain.toml | 4 ++ 5 files changed, 10 insertions(+), 53 deletions(-) delete mode 100644 rust-toolchain create mode 100644 rust-toolchain.toml diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index bb6044cbf08f1..b64b23b584ced 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -4,61 +4,17 @@ inputs: targets: description: 'Comma-separated list of target triples to install for this toolchain' required: false - components: - description: 'Comma-separated list of components to be additionally installed' - required: false - skip-install: - description: 'Sets environment variables without installing the rust toolchain' - required: false runs: using: 'composite' steps: - - name: 'Get toolchain version from file' - id: file - shell: bash - run: echo "toolchain=$(cat ./rust-toolchain)" >> $GITHUB_OUTPUT - - - shell: bash - run: | - : force toolchain version - echo "RUST_TOOLCHAIN=${{ steps.file.outputs.toolchain }}" >> $GITHUB_ENV - - - shell: bash - run: | - : disable incremental compilation - if [ -z "${CARGO_INCREMENTAL+set}" ]; then - echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV - fi - - - shell: bash - run: | - : enable colors in Cargo output - if [ -z "${CARGO_TERM_COLOR+set}" ]; then - echo CARGO_TERM_COLOR=always >> $GITHUB_ENV - fi - - - shell: bash - run: | - : enable rust backtrace - if [ -z "${RUST_BACKTRACE+set}" ]; then - echo RUST_BACKTRACE=short >> $GITHUB_ENV - fi - - - shell: bash - run: | - : enable faster cargo sparse registry - if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" ]; then - echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV - fi - - name: 'Setup Rust toolchain' - uses: dtolnay/rust-toolchain@master - if: ${{ !inputs.skip-install }} + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: ${{ steps.file.outputs.toolchain }} - targets: ${{ inputs.targets }} - components: ${{ inputs.components }} + target: ${{ inputs.targets }} + # needed to not make it override the defaults + rustflags: '' + cache: false - name: 'Add cargo problem matchers' shell: bash diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 9d7c3912eac84..84c1967a83da0 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -255,11 +255,11 @@ jobs: check-latest: true - run: corepack enable + # we always want to run this to set environment variables - name: Install Rust uses: ./.github/actions/setup-rust with: targets: ${{ matrix.settings.target }} - skip-install: ${{ matrix.settings.docker }} - name: normalize versions run: node scripts/normalize-version-bump.js diff --git a/.github/workflows/build_reusable.yml b/.github/workflows/build_reusable.yml index 0d48f5403af8a..83bef38898f47 100644 --- a/.github/workflows/build_reusable.yml +++ b/.github/workflows/build_reusable.yml @@ -105,8 +105,6 @@ jobs: - name: Install Rust uses: ./.github/actions/setup-rust if: ${{ inputs.skipNativeBuild != 'yes' || inputs.needsNextest == 'yes' || inputs.needsRust == 'yes' }} - with: - components: rustfmt, clippy - name: 'Install mold linker' if: ${{ inputs.mold == 'yes' }} diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index fb98c0f091c33..0000000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2024-04-03 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000000..59c3a03ab6aaf --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2024-04-03" +components = ["rustfmt", "clippy"] +profile = "minimal"