Skip to content

Commit 97812c5

Browse files
committed
Test WASM libray in CI
1 parent a2ba20e commit 97812c5

File tree

8 files changed

+1347
-20
lines changed

8 files changed

+1347
-20
lines changed

.circleci/basis.yml

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

33
commands:
4+
install-rsync:
5+
- run: sudo apt update && sudo apt install rsync
46
install-asdf:
57
steps:
68
- run:

.circleci/rolling-shutter.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,22 @@ jobs:
6666
command: |
6767
asdf plugin add tinygo https://github.com/schmir/asdf-tinygo.git || true
6868
asdf plugin add binaryen https://github.com/birros/asdf-binaryen.git || true
69+
asdf plugin add nodejs || true
6970
- run:
7071
name: "Install asdf managed executables"
7172
command: |
7273
asdf install tinygo
7374
asdf install binaryen
75+
asdf install nodejs
7476
- run: make build wasm
77+
- node/install-packages:
78+
app-dir: ../js/shutter-crypto
79+
override-ci-command: npm install
80+
- run: make wasm-js
81+
- run:
82+
name: "Run WASM tests"
83+
command: |
84+
make wasm-js-test
7585
- run:
7686
name: "Run unit tests with gotestsum"
7787
command: |

js/shutter-crypto/.eslintrc.js

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

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)