24
24
cargo-fmt :
25
25
name : cargo fmt
26
26
runs-on : SubtensorCI
27
- strategy :
28
- matrix :
29
- rust-branch :
30
- - nightly-2024-03-05
31
- rust-target :
32
- - x86_64-unknown-linux-gnu
33
- # - x86_64-apple-darwin
34
- os :
35
- - ubuntu-latest
36
- # - macos-latest
37
- include :
38
- - os : ubuntu-latest
39
- # - os: macos-latest
40
27
env :
41
- RELEASE_NAME : development
42
- # RUSTFLAGS: -A warnings
43
28
RUST_BACKTRACE : full
44
- SKIP_WASM_BUILD : 1
45
- TARGET : ${{ matrix.rust-target }}
46
29
steps :
47
30
- name : Check-out repository under $GITHUB_WORKSPACE
48
31
uses : actions/checkout@v4
@@ -51,38 +34,22 @@ jobs:
51
34
run : sudo apt-get update && sudo apt-get install -y build-essential
52
35
53
36
- name : Install Rust Nightly
54
- uses :
actions-rs/[email protected]
55
- with :
56
- toolchain : nightly
57
- components : rustfmt
58
- profile : minimal
37
+ run : |
38
+ rustup install nightly
39
+ rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
40
+
41
+ - name : Utilize Shared Rust Cache
42
+ uses : Swatinem/rust-cache@v2
59
43
60
44
- name : cargo fmt
61
- run : cargo fmt --check --all
45
+ run : cargo +nightly fmt --check --all
62
46
63
47
cargo-clippy-default-features :
64
48
name : cargo clippy
65
49
runs-on : SubtensorCI
66
- strategy :
67
- matrix :
68
- rust-branch :
69
- - stable
70
- rust-target :
71
- - x86_64-unknown-linux-gnu
72
- # - x86_64-apple-darwin
73
- os :
74
- - ubuntu-latest
75
- # - macos-latest
76
- include :
77
- - os : ubuntu-latest
78
- # - os: macos-latest
79
50
env :
80
- RELEASE_NAME : development
81
- # RUSTFLAGS: -A warnings
82
51
RUST_BACKTRACE : full
83
52
SKIP_WASM_BUILD : 1
84
- TARGET : ${{ matrix.rust-target }}
85
- RUST_BIN_DIR : target/${{ matrix.rust-target }}
86
53
steps :
87
54
- name : Check-out repository under $GITHUB_WORKSPACE
88
55
uses : actions/checkout@v4
@@ -93,33 +60,18 @@ jobs:
93
60
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
94
61
95
62
- name : Utilize Shared Rust Cache
96
-
97
- with :
98
- key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
63
+ uses : Swatinem/rust-cache@v2
99
64
100
65
- name : cargo clippy --workspace --all-targets -- -D warnings
101
66
run : cargo clippy --workspace --all-targets -- -D warnings
102
67
103
68
cargo-check-lints :
104
69
name : check custom lints
105
70
runs-on : SubtensorCI
106
- strategy :
107
- matrix :
108
- rust-branch :
109
- - stable
110
- rust-target :
111
- - x86_64-unknown-linux-gnu
112
- # - x86_64-apple-darwin
113
- os :
114
- - ubuntu-latest
115
- # - macos-latest
116
71
env :
117
- RELEASE_NAME : development
118
72
RUSTFLAGS : -D warnings
119
73
RUST_BACKTRACE : full
120
74
SKIP_WASM_BUILD : 1
121
- TARGET : ${{ matrix.rust-target }}
122
- RUST_BIN_DIR : target/${{ matrix.rust-target }}
123
75
steps :
124
76
- name : Check-out repository under $GITHUB_WORKSPACE
125
77
uses : actions/checkout@v4
@@ -129,17 +81,8 @@ jobs:
129
81
sudo apt-get update &&
130
82
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
131
83
132
- - name : Install Rust ${{ matrix.rust-branch }}
133
- uses :
actions-rs/[email protected]
134
- with :
135
- toolchain : ${{ matrix.rust-branch }}
136
- components : rustfmt, clippy
137
- profile : minimal
138
-
139
84
- name : Utilize Shared Rust Cache
140
-
141
- with :
142
- key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
85
+ uses : Swatinem/rust-cache@v2
143
86
144
87
- name : check lints
145
88
run : |
@@ -150,63 +93,31 @@ jobs:
150
93
cargo-clippy-all-features :
151
94
name : cargo clippy --all-features
152
95
runs-on : SubtensorCI
153
- strategy :
154
- matrix :
155
- rust-target :
156
- - x86_64-unknown-linux-gnu
157
- # - x86_64-apple-darwin
158
- os :
159
- - ubuntu-latest
160
- # - macos-latest
161
- include :
162
- - os : ubuntu-latest
163
- # - os: macos-latest
164
96
env :
165
- RELEASE_NAME : development
166
- # RUSTFLAGS: -A warnings
167
97
RUST_BACKTRACE : full
168
- RUST_BIN_DIR : target/${{ matrix.rust-target }}
169
98
SKIP_WASM_BUILD : 1
170
- TARGET : ${{ matrix.rust-target }}
171
99
steps :
172
100
- name : Check-out repository under $GITHUB_WORKSPACE
173
- uses : actions/checkout@v2
101
+ uses : actions/checkout@v4
174
102
175
103
- name : Install dependencies
176
104
run : |
177
105
sudo apt-get update &&
178
106
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
179
107
180
108
- name : Utilize Shared Rust Cache
181
-
182
- with :
183
- key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
109
+ uses : Swatinem/rust-cache@v2
184
110
185
111
- name : cargo clippy --workspace --all-targets --all-features -- -D warnings
186
112
run : cargo clippy --workspace --all-targets --all-features -- -D warnings
187
113
188
- # runs cargo test --workspace
114
+ # runs cargo test --workspace --all-features
189
115
cargo-test :
190
116
name : cargo test
191
117
runs-on : SubtensorCI
192
- strategy :
193
- matrix :
194
- rust-target :
195
- - x86_64-unknown-linux-gnu
196
- # - x86_64-apple-darwin
197
- os :
198
- - ubuntu-latest
199
- # - macos-latest
200
- include :
201
- - os : ubuntu-latest
202
- # - os: macos-latest
203
118
env :
204
- RELEASE_NAME : development
205
- # RUSTFLAGS: -A warnings
206
119
RUST_BACKTRACE : full
207
- RUST_BIN_DIR : target/${{ matrix.rust-target }}
208
120
SKIP_WASM_BUILD : 1
209
- TARGET : ${{ matrix.rust-target }}
210
121
steps :
211
122
- name : Check-out repository under $GITHUB_WORKSPACE
212
123
uses : actions/checkout@v4
@@ -216,10 +127,8 @@ jobs:
216
127
sudo apt-get update &&
217
128
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
218
129
219
- - name : Utilize Rust shared cached
220
-
221
- with :
222
- key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
130
+ - name : Utilize Shared Rust Cache
131
+ uses : Swatinem/rust-cache@v2
223
132
224
133
- name : cargo test --workspace --all-features
225
134
run : cargo test --workspace --all-features
@@ -228,26 +137,9 @@ jobs:
228
137
cargo-fix :
229
138
name : cargo fix
230
139
runs-on : SubtensorCI
231
- strategy :
232
- matrix :
233
- rust-branch :
234
- - stable
235
- rust-target :
236
- - x86_64-unknown-linux-gnu
237
- # - x86_64-apple-darwin
238
- os :
239
- - ubuntu-latest
240
- # - macos-latest
241
- include :
242
- - os : ubuntu-latest
243
- # - os: macos-latest
244
140
env :
245
- RELEASE_NAME : development
246
- # RUSTFLAGS: -A warnings
247
141
RUST_BACKTRACE : full
248
- RUST_BIN_DIR : target/${{ matrix.rust-target }}
249
142
SKIP_WASM_BUILD : 1
250
- TARGET : ${{ matrix.rust-target }}
251
143
steps :
252
144
- name : Check-out repository under $GITHUB_WORKSPACE
253
145
uses : actions/checkout@v4
@@ -257,10 +149,8 @@ jobs:
257
149
sudo apt-get update &&
258
150
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
259
151
260
- - name : Utilize Rust shared cached
261
-
262
- with :
263
- key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
152
+ - name : Utilize Shared Rust Cache
153
+ uses : Swatinem/rust-cache@v2
264
154
265
155
- name : cargo fix --workspace
266
156
run : |
@@ -280,13 +170,16 @@ jobs:
280
170
runs-on : SubtensorCI
281
171
282
172
steps :
283
- - name : Install Zepter
284
- run : cargo install --locked -q zepter && zepter --version
285
-
286
173
- name : Checkout
287
174
uses : actions/checkout@v4
288
175
with :
289
176
fetch-depth : 0 # Dont clone historic commits.
290
177
178
+ - name : Utilize Shared Rust Cache
179
+ uses : Swatinem/rust-cache@v2
180
+
181
+ - name : Install Zepter
182
+ run : cargo install --locked -q zepter && zepter --version
183
+
291
184
- name : Check features
292
185
run : zepter run check
0 commit comments