CI: Add WASM script
In preparation for using the `run_task` script from maintainer tools we want to have all the things that are particular to `rust-bitcoin` out of the current `run_task` script. The wasm test is specific to `hashes`. Add a script in `hashes/contrib` and call it from the wasm job. No test coverage change.
This commit is contained in:
parent
cc14edf63f
commit
3407257936
|
@ -246,8 +246,8 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: "Select toolchain"
|
- name: "Select toolchain"
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
- name: "Run test script"
|
- name: "Run wasm script"
|
||||||
run: ./contrib/run_task.sh wasm
|
run: cd hashes && ./contrib/wasm.sh
|
||||||
|
|
||||||
Schemars: # hashes crate only.
|
Schemars: # hashes crate only.
|
||||||
name: Schemars - stable toolchain
|
name: Schemars - stable toolchain
|
||||||
|
|
|
@ -90,11 +90,6 @@ main() {
|
||||||
do_bench
|
do_bench
|
||||||
;;
|
;;
|
||||||
|
|
||||||
wasm)
|
|
||||||
# hashes crate only.
|
|
||||||
do_wasm
|
|
||||||
;;
|
|
||||||
|
|
||||||
asan)
|
asan)
|
||||||
# hashes crate only - hashes/contrib/test_vars.sh is sourced in this function.
|
# hashes crate only - hashes/contrib/test_vars.sh is sourced in this function.
|
||||||
do_asan
|
do_asan
|
||||||
|
@ -259,20 +254,6 @@ do_bench() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Note we do not use the recent lock file or `--locked` when running the wasm tests.
|
|
||||||
do_wasm() {
|
|
||||||
pushd "$REPO_DIR/hashes" > /dev/null
|
|
||||||
|
|
||||||
clang --version &&
|
|
||||||
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack &&
|
|
||||||
printf '\n[target.wasm32-unknown-unknown.dev-dependencies]\nwasm-bindgen-test = "0.3"\n' >> Cargo.toml &&
|
|
||||||
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml &&
|
|
||||||
CC=clang-9 wasm-pack build &&
|
|
||||||
CC=clang-9 wasm-pack test --node;
|
|
||||||
|
|
||||||
popd > /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
do_asan() {
|
do_asan() {
|
||||||
pushd "$REPO_DIR/hashes" > /dev/null
|
pushd "$REPO_DIR/hashes" > /dev/null
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Run the WASM tests.
|
||||||
|
|
||||||
|
set -euox pipefail
|
||||||
|
|
||||||
|
clang --version &&
|
||||||
|
CARGO_TARGET_DIR=wasm cargo install --force wasm-pack &&
|
||||||
|
printf '\n[target.wasm32-unknown-unknown.dev-dependencies]\nwasm-bindgen-test = "0.3"\n' >> Cargo.toml &&
|
||||||
|
printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml &&
|
||||||
|
CC=clang-9 wasm-pack build &&
|
||||||
|
CC=clang-9 wasm-pack test --node;
|
Loading…
Reference in New Issue