Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is covered by deploy.yml, so I think no need to duplicate test it here?

Emm... I think that deploy test is a bit more, so I get you now. Make sense to test build for wasm here in CI.

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
5 changes: 5 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Comment on lines +33 to +37

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume wasm-pack build will build it with wasm32 target no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is faster to fail invalid wasm . no need to run build if that fails

- name: Build WASM
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions vizmat-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,16 @@ <h1 class="site-title">vizmat <span>molecule / crystal</span> visual lab</h1>
<div class="canvas-shell">
<canvas id="bevy-canvas"></canvas>
</div>
<input
id="picker-keyboard-input"
type="text"
inputmode="search"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
enterkeyhint="search"
aria-label="Structure search"
>
</body>
</html>
Loading