@@ -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,15 @@ jobs:
122
110
cargo -V
123
111
rustc -V
124
112
113
+ - name : Cross build
114
+ if : ${{ matrix.job.use-cross == true }}
115
+ run : |
116
+ cargo install cross
117
+ cross build --locked --release --target=${{ matrix.job.target }}
118
+
125
119
- 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 }}
120
+ if : ${{ matrix.job.use-cross == false }}
121
+ run : cargo build --locked --release --target=${{ matrix.job.target }}
131
122
132
123
- name : Strip debug information from executable
133
124
id : strip
@@ -174,12 +165,15 @@ jobs:
174
165
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}" ;; esac;
175
166
echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
176
167
168
+ - name : Run cross tests
169
+ if : ${{ matrix.job.use-cross == true }}
170
+ run : |
171
+ cargo install cross
172
+ cross test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
173
+
177
174
- 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}}
175
+ if : ${{ matrix.job.use-cross == false }}
176
+ run : cargo test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
183
177
184
178
- name : Generate completions
185
179
id : completions
0 commit comments