Skip to content

Commit

Permalink
update toolchain
Browse files Browse the repository at this point in the history
fix action
  • Loading branch information
ForsakenHarmony committed Mar 18, 2024
1 parent 15bd8e9 commit 6501fe5
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 311 deletions.
54 changes: 5 additions & 49 deletions .github/actions/setup-rust/action.yml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_reusable.yml
Expand Up @@ -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' }}
Expand Down

0 comments on commit 6501fe5

Please sign in to comment.