Skip to content

Commit 8c3e074

Browse files
authored
Merge pull request #433 from shutter-network/wasm_tests
Upgrade the WASM library
2 parents 3ac384e + 17ac71d commit 8c3e074

File tree

11 files changed

+8705
-1215
lines changed

11 files changed

+8705
-1215
lines changed

.circleci/basis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
version: 2.1
22

33
commands:
4+
install-rsync:
5+
steps:
6+
- run:
7+
name: Install rsync
8+
command: |
9+
sudo apt update && sudo apt install rsync
410
install-asdf:
511
steps:
612
- run:

.circleci/rolling-shutter.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,29 @@ jobs:
6060
- restore_cache:
6161
keys:
6262
- rs-build-<< parameters.go-version >>-v4-{{ checksum "go.sum" }}-{{ checksum "go.mod" }}
63+
- install-rsync
6364
- install-asdf
6465
- run:
6566
name: "Install asdf plugins"
6667
command: |
6768
asdf plugin add tinygo https://github.com/schmir/asdf-tinygo.git || true
6869
asdf plugin add binaryen https://github.com/birros/asdf-binaryen.git || true
70+
asdf plugin add nodejs || true
6971
- run:
7072
name: "Install asdf managed executables"
7173
command: |
7274
asdf install tinygo
7375
asdf install binaryen
76+
asdf install nodejs
7477
- run: make build wasm
78+
- node/install-packages:
79+
app-dir: ../js/shutter-crypto
80+
override-ci-command: npm install
81+
- run: make wasm-js
82+
- run:
83+
name: "Run WASM tests"
84+
command: |
85+
make wasm-js-test
7586
- run:
7687
name: "Run unit tests with gotestsum"
7788
command: |

js/shutter-crypto/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
extends: "eslint:recommended",
3+
ignorePatterns: ["derived/*.js"],
4+
parserOptions: {
5+
sourceType: "module",
6+
},
7+
env: {
8+
browser: true,
9+
jest: true,
10+
node: true,
11+
},
12+
};

js/shutter-crypto/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ NPM ?= npm
44
NPX ?= npx
55
TINYGO ?= tinygo
66

7-
build: derive
7+
clean:
8+
rm -r dist
9+
mkdir -p dist
10+
11+
build: clean derive
812
${NPX} webpack build
9-
cp -L derived/shutter-crypto.wasm dist/
13+
rsync derived/shutter-crypto.wasm dist/shutter-crypto.wasm
1014

1115
publish: build
1216
${NPM} publish --access=public
@@ -22,5 +26,7 @@ derived/wasm_exec.js:
2226
cp $(shell ${TINYGO} env TINYGOROOT)/targets/wasm_exec.js derived/
2327
patch --quiet --directory derived --strip 1 --input ../patches/wasm_exec.patch
2428

29+
test:
30+
${NPM} test
2531

26-
.PHONY: build derive publish
32+
.PHONY: build derive publish test

0 commit comments

Comments
 (0)