@@ -11,48 +11,80 @@ inputs:
1111 description : " Target triple"
1212 required : false
1313 default : " "
14+ override-dir :
15+ description : " Directory to set the rustup override for"
16+ required : false
17+ default : " ."
1418
1519runs :
1620 using : " composite"
1721 steps :
18- - name : Install ${{ inputs.toolchain }} toolchain
22+ - name : Install toolchain
1923 shell : bash
20- run : rustup toolchain install "${{ inputs.toolchain }}" --profile minimal
24+ working-directory : ${{ inputs.override-dir }}
25+ env :
26+ TOOLCHAIN : ${{ inputs.toolchain }}
27+ run : |
28+ rustup toolchain install "$TOOLCHAIN" --profile minimal
2129
22- - name : Update ${{ inputs.toolchain }} toolchain
30+ - name : Update toolchain
2331 shell : bash
24- run : rustup update "${{ inputs.toolchain }}"
32+ working-directory : ${{ inputs.override-dir }}
33+ env :
34+ TOOLCHAIN : ${{ inputs.toolchain }}
35+ run : |
36+ rustup update "$TOOLCHAIN"
2537
2638 - name : Install additional target
2739 shell : bash
40+ working-directory : ${{ inputs.override-dir }}
2841 if : inputs.target != ''
29- run : rustup target add --toolchain "${{ inputs.toolchain }}" "${{ inputs.target }}"
42+ env :
43+ TOOLCHAIN : ${{ inputs.toolchain }}
44+ TARGET : ${{ inputs.target }}
45+ run : |
46+ rustup target add --toolchain "$TOOLCHAIN" "$TARGET"
3047
31- - name : Set default toolchain to ${{ inputs.toolchain }}
48+ - name : Set default toolchain
3249 shell : bash
33- # https://rust-lang.github.io/rustup/overrides.html
34- run : echo 'RUSTUP_TOOLCHAIN=${{ inputs.toolchain }}' >> "$GITHUB_ENV"
50+ working-directory : ${{ inputs.override-dir }}
51+ env :
52+ TOOLCHAIN : ${{ inputs.toolchain }}
53+ run : |
54+ # https://rust-lang.github.io/rustup/overrides.html
55+ rustup override set "$TOOLCHAIN"
3556
3657 - name : Show rustup version
3758 shell : bash
38- run : rustup -Vv
59+ working-directory : ${{ inputs.override-dir }}
60+ run : |
61+ rustup -Vv
3962
40- - name : Show ${{ inputs.toolchain }} rustc version
63+ - name : Show rustc version
4164 shell : bash
42- run : rustc +${{ inputs.toolchain }} -Vv
65+ working-directory : ${{ inputs.override-dir }}
66+ env :
67+ TOOLCHAIN : ${{ inputs.toolchain }}
68+ run : |
69+ rustc +"$TOOLCHAIN" -Vv
4370
44- - name : Show ${{ inputs.toolchain }} cargo version
71+ - name : Show cargo version
4572 shell : bash
46- run : cargo +${{ inputs.toolchain }} version --verbose
73+ working-directory : ${{ inputs.override-dir }}
74+ env :
75+ TOOLCHAIN : ${{ inputs.toolchain }}
76+ run : |
77+ cargo +"$TOOLCHAIN" version --verbose
4778
4879 - name : Check if Cargo.lock is present
4980 shell : bash
81+ working-directory : ${{ inputs.override-dir }}
5082 id : lockfile
5183 run : |
5284 if [[ -f Cargo.lock ]]; then
53- echo "present=true" >> $GITHUB_OUTPUT
85+ echo "present=true" >> " $GITHUB_OUTPUT"
5486 else
55- echo "present=false" >> $GITHUB_OUTPUT
87+ echo "present=false" >> " $GITHUB_OUTPUT"
5688 fi
5789
5890 - name : Setup Rust caching
0 commit comments