diff --git a/.github/workflows/plotter-test.yml b/.github/workflows/plotter-test.yml new file mode 100644 index 0000000000..d509759003 --- /dev/null +++ b/.github/workflows/plotter-test.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +permissions: + checks: write + pull-requests: write + +jobs: + template_test_current: + name: Plotter tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + + - name: Run plotter tests + run: | + cd tools/plotter + cargo test diff --git a/tools/plotter/start-server.sh b/tools/plotter/start-server.sh index 09641b1a03..3a5698f05e 100755 --- a/tools/plotter/start-server.sh +++ b/tools/plotter/start-server.sh @@ -1,8 +1,6 @@ #!/bin/bash set -e -mkdir -p www/pkg - ./build-wasm.sh cd www diff --git a/tools/plotter/www/bootstrap.js b/tools/plotter/www/bootstrap.js index bea8b6b67a..2520df8952 100644 --- a/tools/plotter/www/bootstrap.js +++ b/tools/plotter/www/bootstrap.js @@ -4,14 +4,14 @@ async function init() { if (typeof process == "object") { // We run in the npm/webpack environment. const [{Chart}, {main, setup}] = await Promise.all([ - import("wasm-demo"), + import("sc-plotter-wasm"), import("./index.js"), ]); setup(Chart); main(); } else { const [{Chart, default: init}, {main, setup}] = await Promise.all([ - import("../pkg/wasm_demo.js"), + import("../pkg/sc_plotter_wasm.js"), import("./index.js"), ]); await init(); diff --git a/tools/plotter/www/package.json b/tools/plotter/www/package.json index 32a99f8aff..87f6fd3412 100644 --- a/tools/plotter/www/package.json +++ b/tools/plotter/www/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/38/plotters", "dependencies": { - "wasm-demo": "file:../pkg" + "sc-plotter-wasm": "file:../pkg" }, "devDependencies": { "webpack": "^4.43.0",