forked from zkonduit/ezkl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: comprehensive WASM tests in JS (zkonduit#483)
- Loading branch information
1 parent
a329d2c
commit 7d7de3e
Showing
12 changed files
with
2,723 additions
and
75 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 |
---|---|---|
|
@@ -154,6 +154,7 @@ jobs: | |
- name: Circuit Render | ||
run: cargo nextest run --release --verbose tests::tutorial_ | ||
|
||
|
||
mock-proving-tests: | ||
runs-on: self-hosted | ||
# needs: [build, library-tests, docs] | ||
|
@@ -250,6 +251,39 @@ jobs: | |
toolchain: nightly-2023-08-24 | ||
override: true | ||
components: rustfmt, clippy | ||
- uses: jetli/[email protected] | ||
- name: Add wasm32-unknown-unknown target | ||
run: rustup target add wasm32-unknown-unknown | ||
|
||
- name: Install wasm-server-runner | ||
run: cargo install wasm-server-runner | ||
|
||
- name: Add rust-src | ||
run: rustup component add rust-src --toolchain nightly-2023-08-24-x86_64-unknown-linux-gnu | ||
|
||
- name: Build wasm files for both web and nodejs compilation targets | ||
run: | | ||
wasm-pack build --target nodejs --out-dir ./tests/wasm/nodejs . -- -Z build-std="panic_abort,std" | ||
- name: Replace memory definition in nodejs | ||
run: | | ||
sed -i "3s|.*|imports['env'] = {memory: new WebAssembly.Memory({initial:20,maximum:65536,shared:true})}|" tests/wasm/nodejs/ezkl.js | ||
- uses: actions/checkout@v3 | ||
- name: Use pnpm 8 | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Use Node.js 18.12.1 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.12.1' | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
run: | | ||
pnpm install --no-frozen-lockfile | ||
env: | ||
CI: false | ||
NODE_ENV: development | ||
- uses: baptiste0928/cargo-install@v1 | ||
with: | ||
crate: cargo-nextest | ||
|
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 |
---|---|---|
|
@@ -42,4 +42,6 @@ var/ | |
*.egg | ||
.vscode/ | ||
*.whl | ||
*.bak | ||
*.bak | ||
node_modules | ||
timingData.json |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "wasm-tests", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.3", | ||
"@types/node": "20.4.5", | ||
"jest": "^29.6.3", | ||
"@types/file-saver": "^2.0.5", | ||
"@types/json-bigint": "^1.0.1", | ||
"env": "^0.0.2", | ||
"fs": "0.0.1-security", | ||
"json-bigint": "^1.0.0", | ||
"minimist": "^1.2.8", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "5.1.6" | ||
} | ||
} |
Oops, something went wrong.