File tree Expand file tree Collapse file tree
.github/actions/setup-rust Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,15 +38,32 @@ runs:
3838 if : runner.os == 'Linux'
3939 uses : rui314/setup-mold@v1
4040
41+ - name : Check for rustup
42+ id : check-rustup
43+ shell : bash
44+ run : echo "exists=$(command -v rustup &> /dev/null && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
45+
4146 - name : Rust Toolchain
4247 id : rust-toolchain
4348 uses : dtolnay/rust-toolchain@stable
44- if : steps.rustup-cache .outputs.cache-hit != 'true'
49+ if : steps.check-rustup .outputs.exists != 'true'
4550 with :
4651 toolchain : " ${{ steps.toolchain-config.outputs.toolchain }}"
4752 targets : " ${{ inputs.targets }}"
4853 components : " ${{ inputs.components }}"
4954
55+ - name : Install additional targets and components
56+ if : steps.check-rustup.outputs.exists == 'true'
57+ shell : bash
58+ run : |
59+ rustup toolchain install "$TOOLCHAIN"
60+ [[ -n "$TARGETS" ]] && rustup target add --toolchain "$TOOLCHAIN" ${TARGETS//,/ }
61+ [[ -n "$COMPONENTS" ]] && rustup component add --toolchain "$TOOLCHAIN" ${COMPONENTS//,/ }
62+ env :
63+ TOOLCHAIN : ${{ steps.toolchain-config.outputs.toolchain }}
64+ TARGETS : ${{ inputs.targets }}
65+ COMPONENTS : ${{ inputs.components }}
66+
5067 - name : Configure sccache timeout
5168 if : inputs.enable-sccache == 'true'
5269 shell : bash
You can’t perform that action at this time.
0 commit comments