@@ -11,48 +11,80 @@ inputs:
11
11
description : " Target triple"
12
12
required : false
13
13
default : " "
14
+ override-dir :
15
+ description : " Directory to set the rustup override for"
16
+ required : false
17
+ default : " ."
14
18
15
19
runs :
16
20
using : " composite"
17
21
steps :
18
- - name : Install ${{ inputs.toolchain }} toolchain
22
+ - name : Install toolchain
19
23
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
21
29
22
- - name : Update ${{ inputs.toolchain }} toolchain
30
+ - name : Update toolchain
23
31
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"
25
37
26
38
- name : Install additional target
27
39
shell : bash
40
+ working-directory : ${{ inputs.override-dir }}
28
41
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"
30
47
31
- - name : Set default toolchain to ${{ inputs.toolchain }}
48
+ - name : Set default toolchain
32
49
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"
35
56
36
57
- name : Show rustup version
37
58
shell : bash
38
- run : rustup -Vv
59
+ working-directory : ${{ inputs.override-dir }}
60
+ run : |
61
+ rustup -Vv
39
62
40
- - name : Show ${{ inputs.toolchain }} rustc version
63
+ - name : Show rustc version
41
64
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
43
70
44
- - name : Show ${{ inputs.toolchain }} cargo version
71
+ - name : Show cargo version
45
72
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
47
78
48
79
- name : Check if Cargo.lock is present
49
80
shell : bash
81
+ working-directory : ${{ inputs.override-dir }}
50
82
id : lockfile
51
83
run : |
52
84
if [[ -f Cargo.lock ]]; then
53
- echo "present=true" >> $GITHUB_OUTPUT
85
+ echo "present=true" >> " $GITHUB_OUTPUT"
54
86
else
55
- echo "present=false" >> $GITHUB_OUTPUT
87
+ echo "present=false" >> " $GITHUB_OUTPUT"
56
88
fi
57
89
58
90
- name : Setup Rust caching
0 commit comments