Skip to content

Commit

Permalink
ci: add wasm check
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor authored and conorsch committed Mar 28, 2024
1 parent 50d1643 commit 4c3e05b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ jobs:
- uses: actions/checkout@v4
with:
lfs: true

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Load rust cache
uses: astriaorg/[email protected]

- name: Run cargo check, failing on warnings
run: cargo check --release --all-targets
env:
# The `-D warnings` option causes an error on warnings;
# we must duplicate the rustflags from `.cargo/config.toml`.
RUSTFLAGS: "-D warnings --cfg tokio_unstable"
- name: Check wasm compatibility
run: ./deployments/scripts/check-wasm-compat.sh

# If a dependency was modified, Cargo.lock may flap if not committed.
- name: Check for diffs
Expand All @@ -35,6 +41,7 @@ jobs:
else
echo "OK: no uncommitted changes detected"
fi
- name: Run tests with nextest
run: cargo nextest run --release --features migration
env:
Expand Down
41 changes: 41 additions & 0 deletions deployments/scripts/check-wasm-compat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

set -e

packages=(
"penumbra-asset"
"penumbra-tct"
"penumbra-community-pool"
"penumbra-compact-block"
"penumbra-dex"
"penumbra-distributions"
"penumbra-fee"
"penumbra-funding"
"penumbra-governance"
"penumbra-ibc"
"penumbra-sct"
"penumbra-shielded-pool"
"penumbra-stake"
"penumbra-keys"
"penumbra-transaction"
"penumbra-txhash"
# Note: we can't include those ones because they rely on `getrandom`
# but there's a `js` feature...
# "penumbra-num"
# "penumbra-proto"
# "decaf377-fmd"
# "decaf377-frost"
# "decaf377-ka"
# "penumbra-proof-params"
)

for package in "${packages[@]}"; do
echo "Building package: $package"
cargo check --release --target wasm32-unknown-unknown --package "$package" --no-default-features
if [ $? -ne 0 ]; then
echo "Compile error encountered while building package $package"
exit 1
fi
echo "Package $package built successfully"
echo "------------------------"
done

0 comments on commit 4c3e05b

Please sign in to comment.