-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add per-crate checks via cargo-hack
Suggested by @erwanor, based on the Astria CI config [0]. The goal is to ensure that our default feature sets actually work, by compiling each crate in the workspace individually. fix: feature-gating across the workspace Satisifes the new CI check by massaging the feature sets. [0] https://github.com/astriaorg/astria/blob/6cc8e2b828f8f5ee65e03c2b3383c4252b4c6b81/.github/workflows/test.yml#L64-L68
- Loading branch information
Showing
6 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,18 @@ jobs: | |
- name: Load rust cache | ||
uses: astriaorg/[email protected] | ||
- run: cargo fmt --all -- --check | ||
|
||
check: | ||
name: Check all crate features | ||
runs-on: buildjet-8vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Load rust cache | ||
uses: astriaorg/[email protected] | ||
- name: install cargo-hack | ||
run: cargo install cargo-hack | ||
# Build each crate separately, to validate that the feature-gating is working. | ||
# This is a lighter-weight version of `cargo check-all-features --workspace --release`. | ||
- run: ./deployments/scripts/check-crate-feature-sets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
# CI script to verify that each crate in the monorepo builds independently. | ||
# This helps us ensure that the feature-gating for e.g. "component" is | ||
# declared explicitly. | ||
set -euo pipefail | ||
|
||
|
||
if ! hash cargo-hack >/dev/null 2>&1 ; then | ||
>&2 echo "ERROR: cargo-hack not found. Install it with: cargo install cargo-hack" | ||
exit 1 | ||
fi | ||
|
||
cargo hack check --workspace --all-targets --all-features --release |