11
11
pull_request :
12
12
13
13
jobs :
14
+ stable :
15
+ name : " Test MSRV and Stable Features"
16
+ strategy :
17
+ matrix :
18
+ rust :
19
+ - nightly
20
+ - 1.59
21
+ - 1.57
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - uses : actions/checkout@v3
25
+ - uses : actions-rs/toolchain@v1
26
+ with :
27
+ profile : minimal
28
+ toolchain : ${{ matrix.rust }}
29
+ override : true
30
+ - name : Run cargo build for stable
31
+ if : matrix.rust != 1.57
32
+ uses : actions-rs/cargo@v1
33
+ with :
34
+ command : build
35
+ args : --no-default-features --features instructions
36
+ - name : Run cargo build for stable without instructions
37
+ uses : actions-rs/cargo@v1
38
+ with :
39
+ command : build
40
+ args : --no-default-features
41
+ - name : Run cargo doc for stable
42
+ if : matrix.rust != 1.57
43
+ uses : actions-rs/cargo@v1
44
+ with :
45
+ command : doc
46
+ args : --no-default-features --features instructions
47
+ - name : Run cargo doc for stable without instructions
48
+ uses : actions-rs/cargo@v1
49
+ with :
50
+ command : doc
51
+ args : --no-default-features
52
+ - name : Run cargo test for stable
53
+ if : matrix.rust != 1.57
54
+ uses : actions-rs/cargo@v1
55
+ with :
56
+ command : test
57
+ args : --no-default-features --features instructions
58
+ - name : Run cargo test for stable without instructions
59
+ uses : actions-rs/cargo@v1
60
+ with :
61
+ command : test
62
+ args : --no-default-features
63
+
14
64
test :
15
65
name : " Test"
16
66
@@ -27,23 +77,13 @@ jobs:
27
77
timeout-minutes : 15
28
78
29
79
steps :
30
- - name : " Checkout Repository"
31
- uses : actions/checkout@v1
32
-
33
- - name : Install Rustup
34
- run : |
35
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
36
- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
37
- if : runner.os == 'macOS'
38
-
39
- - name : Set Rustup profile to minimal
40
- run : rustup set profile minimal
41
-
42
- - name : Install musl target on Linux
43
- run : |
44
- rustup target add x86_64-unknown-linux-musl
45
- sudo apt-get install musl-tools musl-dev
46
- if : runner.os == 'Linux'
80
+ - uses : actions/checkout@v3
81
+ - uses : actions-rs/toolchain@v1
82
+ with :
83
+ profile : minimal
84
+ toolchain : nightly
85
+ override : true
86
+ target : x86_64-unknown-linux-musl
47
87
48
88
- name : " Print Rust Version"
49
89
run : |
@@ -60,56 +100,23 @@ jobs:
60
100
with :
61
101
command : doc
62
102
63
- - name : " Run cargo doc for stable"
64
- uses : actions-rs/cargo@v1
65
- with :
66
- command : doc
67
- args : --no-default-features --features instructions
68
- if : runner.os != 'Windows'
69
-
70
- - name : " Run cargo doc without default features"
71
- uses : actions-rs/cargo@v1
72
- with :
73
- command : doc
74
- args : --no-default-features
75
-
76
- - name : " Run cargo build for stable without instructions"
77
- uses : actions-rs/cargo@v1
78
- with :
79
- command : build
80
- args : --no-default-features
81
-
82
- - name : " Run cargo build for stable"
103
+ - name : " Run cargo build on musl"
83
104
uses : actions-rs/cargo@v1
84
105
with :
85
106
command : build
86
- args : --no-default-features --features instructions
87
- if : runner.os != 'Windows'
88
-
89
- - name : " Run cargo build for stable on musl"
90
- uses : actions-rs/cargo@v1
91
- with :
92
- command : build
93
- args : --target x86_64-unknown-linux-musl --no-default-features --features instructions
107
+ args : --target x86_64-unknown-linux-musl
94
108
if : runner.os == 'Linux'
95
109
96
110
- name : " Run cargo test"
97
111
uses : actions-rs/cargo@v1
98
112
with :
99
113
command : test
100
114
101
- - name : " Run cargo test for stable "
115
+ - name : " Run cargo test on musl "
102
116
uses : actions-rs/cargo@v1
103
117
with :
104
118
command : test
105
- args : --no-default-features --features instructions
106
- if : runner.os != 'Windows'
107
-
108
- - name : " Run cargo test for stable on musl"
109
- uses : actions-rs/cargo@v1
110
- with :
111
- command : test
112
- args : --target x86_64-unknown-linux-musl --no-default-features --features instructions
119
+ args : --target x86_64-unknown-linux-musl
113
120
if : runner.os == 'Linux'
114
121
115
122
- name : " Install Rustup Targets"
@@ -138,11 +145,11 @@ jobs:
138
145
139
146
steps :
140
147
- name : " Checkout Repository"
141
- uses : actions/checkout@v1
148
+ uses : actions/checkout@v3
142
149
143
150
- name : Cache binaries
144
151
id : cache-bin
145
- uses : actions/cache@v1
152
+ uses : actions/cache@v3
146
153
with :
147
154
path : binaries
148
155
key : ${{ runner.OS }}-binaries
@@ -151,7 +158,12 @@ jobs:
151
158
shell : bash
152
159
153
160
- name : " Install Rustup Components"
154
- run : rustup component add rust-src llvm-tools-preview
161
+ uses : actions-rs/toolchain@v1
162
+ with :
163
+ toolchain : nightly
164
+ override : true
165
+ profile : minimal
166
+ components : rust-src, llvm-tools-preview
155
167
- name : " Install cargo-xbuild"
156
168
run : cargo install cargo-xbuild --debug --root binaries
157
169
- name : " Install bootimage"
@@ -189,18 +201,30 @@ jobs:
189
201
runs-on : ubuntu-latest
190
202
timeout-minutes : 2
191
203
steps :
192
- - uses : actions/checkout@v1
193
- - run : rustup toolchain install nightly --profile minimal --component rustfmt
194
- - run : cargo +nightly fmt -- --check
204
+ - uses : actions/checkout@v3
205
+ - uses : actions-rs/toolchain@v1
206
+ with :
207
+ toolchain : nightly
208
+ override : true
209
+ profile : minimal
210
+ components : rustfmt
211
+ - uses : actions-rs/cargo@v1
212
+ with :
213
+ command : fmt
214
+ args : --all -- --check
195
215
196
216
clippy :
197
217
name : " Clippy"
198
218
runs-on : ubuntu-latest
199
219
timeout-minutes : 10
200
220
steps :
201
- - uses : actions/checkout@v1
202
- - run : rustup toolchain install nightly --profile minimal --component clippy
203
- - name : " Run `cargo clippy`"
204
- uses : actions-rs/cargo@v1
221
+ - uses : actions/checkout@v3
222
+ - uses : actions-rs/toolchain@v1
223
+ with :
224
+ toolchain : nightly
225
+ override : true
226
+ profile : minimal
227
+ components : clippy
228
+ - uses : actions-rs/cargo@v1
205
229
with :
206
230
command : clippy
0 commit comments