Skip to content

Commit c74286e

Browse files
committed
test
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 8503ddd commit c74286e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/actions/setup-rust/action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ inputs:
1919
runs:
2020
using: "composite"
2121
steps:
22-
- name: Rust Version
23-
id: rust-version
22+
- name: Resolve Toolchain Config
23+
id: toolchain-config
2424
shell: bash
25-
run: echo "version=$(cat rust-toolchain.toml | grep channel | awk -F'\"' '{print $2}')" >> $GITHUB_OUTPUT
25+
run: |
26+
DEFAULT_VERSION=$(grep channel rust-toolchain.toml | awk -F'"' '{print $2}')
27+
TOOLCHAIN="${TOOLCHAIN_OVERRIDE:-$DEFAULT_VERSION}"
28+
echo "toolchain=$TOOLCHAIN" >> $GITHUB_OUTPUT
29+
echo "targets=$TARGETS" >> $GITHUB_OUTPUT
30+
env:
31+
TOOLCHAIN_OVERRIDE: ${{ inputs.toolchain }}
32+
TARGETS: ${{ inputs.targets }}
2633

2734
- name: Install Mold
2835
if: runner.os == 'Linux'
@@ -33,15 +40,15 @@ runs:
3340
uses: dtolnay/rust-toolchain@stable
3441
if: steps.rustup-cache.outputs.cache-hit != 'true'
3542
with:
36-
toolchain: "${{ inputs.toolchain || steps.rust-version.outputs.version }}"
37-
targets: "${{inputs.targets || ''}}"
43+
toolchain: "${{ steps.toolchain-config.outputs.toolchain }}"
44+
targets: "${{ steps.toolchain-config.outputs.targets }}"
3845
components: "${{ inputs.components || 'clippy, rustfmt' }}"
3946

4047
- name: Rust Dependency Cache
4148
uses: Swatinem/rust-cache@v2
4249
with:
4350
save-if: ${{ github.ref_name == 'develop' }}
44-
shared-key: "rust-cache-${{ runner.os }}-${{ runner.arch }}-${{ runner.environment }}"
51+
shared-key: "rust-cache-${{ runner.os }}-${{ runner.arch }}-${{ runner.environment }}-${{ steps.toolchain-config.outputs.toolchain }}-${{ steps.toolchain-config.outputs.targets }}"
4552

4653
- name: Rust Compile Cache
4754
uses: mozilla-actions/[email protected]

0 commit comments

Comments
 (0)