@@ -162,6 +162,72 @@ jobs:
162162 cargo -Zgitoxide -Zgit clippy --locked --all-targets --features rocm -- -D warnings
163163 if : runner.os == 'Windows'
164164
165+ cargo-runtime-build :
166+ strategy :
167+ matrix :
168+ os : ${{ fromJson(github.repository_owner == 'autonomys' &&
169+ ' [
170+ "runs-on=${{ github.run_id }}/runner=self-hosted-ubuntu-22.04-x86-64",
171+ ["self-hosted", "windows-server-2022-x86-64"],
172+ ["self-hosted", "macos-14-arm64"]
173+ ]' ||
174+ ' ["ubuntu-22.04", "windows-2022", "macos-14"]' ) }}
175+ runs-on : ${{ matrix.os }}
176+
177+ steps :
178+ - name : Checkout
179+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
180+
181+ # On macOS, we need a proper Clang version, not Apple's custom version without wasm32 support
182+ - name : Install LLVM and Clang for macOS
183+ uses : KyleMayes/install-llvm-action@dec985c8d7b46a2f363ea1a78f660c946a3349ea # v2.0.1
184+ with :
185+ env : true
186+ version : 17
187+ if : runner.os == 'macOS'
188+
189+ # Because macOS, see https://andreasfertig.blog/2021/02/clang-and-gcc-on-macos-catalina-finding-the-include-paths/
190+ - name : Configure C compiler macOS
191+ run : |
192+ echo "SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV
193+ if : runner.os == 'macOS'
194+
195+ - name : Install glibtoolize (macOS)
196+ run : brew install libtool
197+ if : runner.os == 'macOS'
198+
199+ - name : Install Protoc
200+ uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
201+ with :
202+ repo-token : ${{ secrets.GITHUB_TOKEN }}
203+
204+ # Needed for hwloc
205+ - name : Install automake (macOS)
206+ run : brew install automake
207+ if : runner.os == 'macOS'
208+
209+ - name : Configure cache
210+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
211+ with :
212+ path : |
213+ ~/.cargo/registry
214+ ~/.cargo/git
215+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
216+ restore-keys : |
217+ ${{ runner.os }}-cargo-
218+
219+ - name : build subspace-runtime
220+ run : |
221+ cargo -Zgitoxide -Zgit build --locked --package subspace-runtime
222+
223+ - name : build evm-domain-runtime
224+ run : |
225+ cargo -Zgitoxide -Zgit build --locked --package evm-domain-runtime
226+
227+ - name : build auto-id-domain-runtime
228+ run : |
229+ cargo -Zgitoxide -Zgit build --locked --package auto-id-domain-runtime
230+
165231 cargo-test :
166232 strategy :
167233 matrix :
@@ -226,3 +292,50 @@ jobs:
226292 - name : cargo nextest run --locked
227293 run : |
228294 cargo -Zgitoxide -Zgit nextest run --locked
295+
296+ # This job checks all crates individually, including no_std and other featureless builds.
297+ # We need to check crates individually for missing features, because cargo does feature
298+ # unification, which hides missing features when crates are built together.
299+ cargo-check-individually :
300+ strategy :
301+ matrix :
302+ # We only want to run these slower checks on the fastest runner
303+ os : ${{ fromJson(github.repository_owner == 'autonomys' &&
304+ ' [
305+ "runs-on=${{ github.run_id }}/runner=self-hosted-ubuntu-22.04-x86-64",
306+ ]' ||
307+ ' ["ubuntu-22.04"]' ) }}
308+ runs-on : ${{ matrix.os }}
309+
310+ steps :
311+ - name : Checkout
312+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
313+
314+ - name : Install Protoc
315+ uses : arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
316+ with :
317+ repo-token : ${{ secrets.GITHUB_TOKEN }}
318+
319+ - name : Configure cache
320+ uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
321+ with :
322+ path : |
323+ ~/.cargo/registry
324+ ~/.cargo/git
325+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
326+ restore-keys : |
327+ ${{ runner.os }}-cargo-
328+
329+ - name : check all crates individually
330+ run : |
331+ for crate in $(grep 'path =' Cargo.toml | sed 's/.*path *= *"\([^"]*\).*/\1/' | sort); do
332+ echo "$crate";
333+ pushd "$crate";
334+ if ! cargo -Zgitoxide -Zgit check --locked --all-targets; then
335+ pwd;
336+ popd;
337+ exit 1;
338+ fi;
339+ pwd;
340+ popd;
341+ done
0 commit comments