diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e629119..7b1c274 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,3 +82,22 @@ jobs: components: rustfmt - name: Run cargo fmt run: cargo fmt --all -- --check + + # Run wasm compile checks to catch web-only type mismatches. + wasm_check: + name: Wasm Compile + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + - name: Check wasm target + run: rustup target add wasm32-unknown-unknown + - name: Run wasm compile checks + run: | + cargo check -p vizmat-core --target wasm32-unknown-unknown --no-default-features + cargo check -p vizmat-app --target wasm32-unknown-unknown --no-default-features diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b859071..ba5529b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,6 +30,11 @@ jobs: run: | curl https://drager.github.io/wasm-pack/installer/init.sh -sSf | bash + - name: Run wasm compile checks + run: | + cargo check -p vizmat-core --target wasm32-unknown-unknown --no-default-features + cargo check -p vizmat-app --target wasm32-unknown-unknown --no-default-features + - name: Build WASM run: | if [ "${{ github.ref }}" = "refs/heads/main" ]; then diff --git a/justfile b/justfile index c9fcef9..3d3fcc2 100644 --- a/justfile +++ b/justfile @@ -61,6 +61,11 @@ watch: bench: cargo bench -p vizmat-core --bench bond_cache +wasm-check: + rustup target add wasm32-unknown-unknown + cargo check -p vizmat-core --target wasm32-unknown-unknown --no-default-features + cargo check -p vizmat-app --target wasm32-unknown-unknown --no-default-features + wasm: rustup target add wasm32-unknown-unknown --toolchain nightly-aarch64-apple-darwin cd vizmat-app && PATH="$HOME/.cargo/bin:$PATH" NO_COLOR=false trunk serve --port 8082 diff --git a/vizmat-app/index.html b/vizmat-app/index.html index 8ff2688..0342c71 100644 --- a/vizmat-app/index.html +++ b/vizmat-app/index.html @@ -50,5 +50,16 @@