-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CI check to build wasm for all crates (with runtime-benchmarks fe…
…ature if applicable) (#410) * add CI check to build wasm for all crates (with runtime-benchmarks feature if applicable) * fix: checkout code in wasm check * fix unused warning
- Loading branch information
Showing
5 changed files
with
32 additions
and
8 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 |
---|---|---|
|
@@ -60,4 +60,17 @@ jobs: | |
|
||
- name: Fail-fast; cancel other jobs | ||
if: failure() | ||
uses: andymckay/[email protected] | ||
uses: andymckay/[email protected] | ||
|
||
check-wasm: | ||
if: ${{ !startsWith(github.head_ref, 'release/') }} | ||
name: Check wasm build | ||
runs-on: ubuntu-latest | ||
continue-on-error: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: sudo apt-get install -y protobuf-compiler | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: check-debug-cache | ||
- run: ./scripts/run_for_all_no_std_crates.sh check --no-default-features --target=wasm32-unknown-unknown |
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,18 @@ | ||
find . -name "Cargo.toml" | while read -r CARGO_TOML; do | ||
DIR=$(dirname "$CARGO_TOML") | ||
echo "Checking in directory: $DIR" | ||
|
||
# Skip the loop if the crate does not have a feature `std` | ||
if ! grep -q "\[features\]" "$CARGO_TOML" || ! grep -q "std = \[" "$CARGO_TOML"; then | ||
echo "Feature 'std' not found in $CARGO_TOML. Skipping." | ||
continue | ||
fi | ||
|
||
if grep -q "\[features\]" "$CARGO_TOML" && grep -q "runtime-benchmarks = \[" "$CARGO_TOML"; then | ||
echo "Feature 'runtime-benchmarks' found, adding this feature." | ||
cargo $COMMAND $@ --features runtime-benchmarks --manifest-path "$CARGO_TOML" | ||
else | ||
echo "Feature 'runtime-benchmarks' not found, running command without this feature" | ||
cargo $COMMAND $@ --manifest-path "$CARGO_TOML"; | ||
fi | ||
done |
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