99 branches : [main, devnet-ready, devnet, testnet, finney]
1010
1111 pull_request :
12- types : [labeled, unlabeled, synchronize]
1312
1413 # # Allow running workflow manually from the Actions tab
1514 workflow_dispatch :
@@ -114,30 +113,33 @@ jobs:
114113 - name : cargo clippy --workspace --all-targets -- -D warnings
115114 run : cargo clippy --workspace --all-targets -- -D warnings
116115
117- cargo-check-lints :
118- name : check custom lints
116+ cargo-clippy-all-features :
117+ name : cargo clippy --all-features
119118 runs-on : SubtensorCI
120119 strategy :
121120 matrix :
122121 rust-branch :
123122 - stable
124123 rust-target :
125124 - x86_64-unknown-linux-gnu
126- # - x86_64-apple-darwin
125+ # - x86_64-apple-darwin
127126 os :
128127 - ubuntu-latest
129128 # - macos-latest
129+ include :
130+ - os : ubuntu-latest
131+ # - os: macos-latest
130132 env :
131133 RELEASE_NAME : development
134+ # RUSTFLAGS: -A warnings
132135 RUSTV : ${{ matrix.rust-branch }}
133- RUSTFLAGS : -D warnings
134136 RUST_BACKTRACE : full
135137 RUST_BIN_DIR : target/${{ matrix.rust-target }}
136138 SKIP_WASM_BUILD : 1
137139 TARGET : ${{ matrix.rust-target }}
138140 steps :
139141 - name : Check-out repository under $GITHUB_WORKSPACE
140- uses : actions/checkout@v4
142+ uses : actions/checkout@v2
141143
142144 - name : Install dependencies
143145 run : |
@@ -156,14 +158,12 @@ jobs:
156158 with :
157159 key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
158160
159- - name : check lints
160- run : |
161- set -o pipefail
162- cargo check 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g" | grep "warning:" && exit 1
163- echo "No warnings found."
161+ - name : cargo clippy --workspace --all-targets --all-features -- -D warnings
162+ run : cargo clippy --workspace --all-targets --all-features -- -D warnings
164163
165- cargo-clippy-all-features :
166- name : cargo clippy --all-features
164+ # runs cargo test --workspace
165+ cargo-test :
166+ name : cargo test
167167 runs-on : SubtensorCI
168168 strategy :
169169 matrix :
@@ -188,43 +188,6 @@ jobs:
188188 TARGET : ${{ matrix.rust-target }}
189189 steps :
190190 - name : Check-out repository under $GITHUB_WORKSPACE
191- uses : actions/checkout@v2
192-
193- - name : Install dependencies
194- run : |
195- sudo apt-get update &&
196- sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
197-
198- - name : Install Rust ${{ matrix.rust-branch }}
199- uses :
actions-rs/[email protected] 200- with :
201- toolchain : ${{ matrix.rust-branch }}
202- components : rustfmt, clippy
203- profile : minimal
204-
205- - name : Utilize Shared Rust Cache
206- 207- with :
208- key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
209-
210- - name : cargo clippy --workspace --all-targets --all-features -- -D warnings
211- run : cargo clippy --workspace --all-targets --all-features -- -D warnings
212- cargo-audit :
213- name : cargo audit
214- runs-on : SubtensorCI
215- if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
216- strategy :
217- matrix :
218- rust-branch :
219- - stable
220- rust-target :
221- - x86_64-unknown-linux-gnu
222- # - x86_64-apple-darwin
223- os :
224- - ubuntu-latest
225- # - macos-latest
226- steps :
227- - name : Check-out repositoroy under $GITHUB_WORKSPACE
228191 uses : actions/checkout@v4
229192
230193 - name : Install dependencies
@@ -239,20 +202,17 @@ jobs:
239202 components : rustfmt, clippy
240203 profile : minimal
241204
242- - name : Utilize Shared Rust Cache
205+ - name : Utilize Rust shared cached
243206244207 with :
245208 key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
246209
247- - name : Install cargo-audit
248- run : cargo install cargo-audit
210+ - name : cargo test --workspace
211+ run : cargo test --workspace
249212
250- - name : cargo audit
251- run : cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this
252-
253- # runs cargo test --workspace
254- cargo-test :
255- name : cargo test
213+ # runs cargo test --workspace --features=runtime-benchmarks
214+ cargo-test-benchmarks :
215+ name : cargo test w/benchmarks
256216 runs-on : SubtensorCI
257217 strategy :
258218 matrix :
@@ -296,8 +256,8 @@ jobs:
296256 with :
297257 key : ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
298258
299- - name : cargo test --workspace --all- features
300- run : cargo test --workspace --all- features
259+ - name : cargo test --workspace --features=runtime-benchmarks
260+ run : cargo test --workspace --features=runtime-benchmarks
301261
302262 # ensures cargo fix has no trivial changes that can be applied
303263 cargo-fix :
@@ -379,3 +339,4 @@ jobs:
379339
380340 - name : Check features
381341 run : zepter run check
342+
0 commit comments