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