diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3991566..613940b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,3 +36,25 @@ jobs: with: command: build args: --no-default-features + + # https://rustwasm.github.io/docs/book/reference/add-wasm-support-to-crate.html#maintaining-ongoing-support-for-webassembly + web_assembly: + name: WebAssembly - Release build + runs-on: ubuntu-latest + strategy: + matrix: + arch: + - wasm32-unknown-unknown + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.arch }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + args: --no-default-features --target ${{ matrix.arch }} diff --git a/Cargo.toml b/Cargo.toml index 1d35506..eb7e454 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ default-features = false [dependencies.getrandom] version = "0.2" +features = [ "js" ] [dependencies.ct-codecs] version = "1.1.1" diff --git a/README.md b/README.md index 57d4c83..05af4ea 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This library includes: - [x] Pure-Rust implementation of the Version 4 and 2 protocol - [x] PASERK support (limited amount of PASERK-types) - [x] `#![no_std]` (with default-features disabled) and `#![forbid(unsafe_code)]` +- [x] WASM-friendly (`wasm32-unknown-unknown` using `#![no_std]`) - [x] Fuzzing targets - [x] Test vectors - [x] Usage examples