-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add headless browser tests for wasm
Squashed the following commits by @TalDerei: * update wasm readme and add action workflow file * trigger workflow on pull-request * add assertion check to wasm unit test * modify path in ci workflow * attemp to pass CI * add wasm-pack binary to workflow * attempt to run in headless browser mode * add firefox execution environment We struggled a bit in getting the test to pass CI, but it was as simple as ensuring that lfs=true on the repo checkout. Closes #3475.
- Loading branch information
Showing
3 changed files
with
35 additions
and
11 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 |
---|---|---|
|
@@ -85,24 +85,24 @@ jobs: | |
- name: Load rust cache | ||
uses: astriaorg/[email protected] | ||
|
||
- name: build wasm32 target | ||
run: cargo build --release --target wasm32-unknown-unknown | ||
# TODO: consider failing on warnings here. A few dead-code | ||
# warnings, leaving as-is because wasm is undergoing rapid dev | ||
# in support of web extension. | ||
working-directory: crates/wasm | ||
|
||
# Download prebuilt binary for wasm-pack; faster than `cargo install`. | ||
- uses: jetli/[email protected] | ||
with: | ||
version: 'latest' | ||
|
||
# `wasm-pack build` will automatically compile to target wasm32-unknown-unknown, | ||
# but we run it as a separate task to isolate potential failures in the build pipeline. | ||
# Ensure that wasm crate builds cleanly. Is this superfluous, given `wasm-pack test` below? | ||
- name: run wasm-pack build | ||
run: wasm-pack build | ||
working-directory: crates/wasm | ||
|
||
# Download firefox | ||
- uses: browser-actions/setup-firefox@v1 | ||
- run: firefox --version | ||
|
||
- name: Run headless browser tests | ||
run: wasm-pack test --headless --firefox -- --test test_build --target wasm32-unknown-unknown --release --features "mock-database" | ||
working-directory: crates/wasm | ||
|
||
# Always show the results of `cargo tree`, even if the tests failed, since that | ||
# output will be immediately useful in debugging. | ||
- name: display mio deps | ||
|
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