@@ -28,17 +28,11 @@ jobs:
28
28
profile : minimal # minimal component installation (ie, no documentation)
29
29
components : clippy, rustfmt
30
30
- name : Ensure `cargo fmt` has been run
31
- uses : actions-rs/cargo@v1
32
- with :
33
- command : fmt
34
- args : -- --check
31
+ run : cargo fmt --check
35
32
- name : Ensure MSRV is set in `clippy.toml`
36
33
run : grep "^msrv = \"${{ env.MIN_SUPPORTED_RUST_VERSION }}\"\$" clippy.toml
37
34
- name : Run clippy
38
- uses : actions-rs/cargo@v1
39
- with :
40
- command : clippy
41
- args : --locked --all-targets --all-features
35
+ run : cargo clippy --locked --all-targets --all-features
42
36
43
37
min_version :
44
38
name : Minimum supported rust version
55
49
components : clippy
56
50
profile : minimal
57
51
- name : Run clippy (on minimum supported rust version to prevent warnings we can't fix)
58
- uses : actions-rs/cargo@v1
59
- with :
60
- command : clippy
61
- args : --locked --all-targets --all-features
52
+ run : cargo clippy --locked --all-targets --all-features
62
53
- name : Run tests
63
- uses : actions-rs/cargo@v1
64
- with :
65
- command : test
66
- args : --locked
54
+ run : cargo test --locked
67
55
68
56
build :
69
57
name : ${{ matrix.job.os }} (${{ matrix.job.target }})
@@ -122,12 +110,20 @@ jobs:
122
110
cargo -V
123
111
rustc -V
124
112
113
+ - name : Set cargo cmd
114
+ run : |
115
+ echo "CARGO_CMD=cargo" >> $GITHUB_ENV
116
+ echo "CARGO_CMD=cargo" >> $Env:GITHUB_ENV
117
+
118
+ - name : Install cross
119
+ if : ${{ matrix.job.use-cross == true }}
120
+ run : |
121
+ cargo install cross
122
+ echo "CARGO_CMD=cross" >> $GITHUB_ENV
123
+ echo "CARGO_CMD=cross" >> $Env:GITHUB_ENV
124
+
125
125
- name : Build
126
- uses : actions-rs/cargo@v1
127
- with :
128
- use-cross : ${{ matrix.job.use-cross }}
129
- command : build
130
- args : --locked --release --target=${{ matrix.job.target }}
126
+ run : ${{ env.CARGO_CMD }} build --locked --release --target=${{ matrix.job.target }}
131
127
132
128
- name : Strip debug information from executable
133
129
id : strip
@@ -175,11 +171,7 @@ jobs:
175
171
echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> $GITHUB_OUTPUT
176
172
177
173
- name : Run tests
178
- uses : actions-rs/cargo@v1
179
- with :
180
- use-cross : ${{ matrix.job.use-cross }}
181
- command : test
182
- args : --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
174
+ run : ${{ env.CARGO_CMD }} test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
183
175
184
176
- name : Generate completions
185
177
id : completions
0 commit comments