Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotter package fix + CI #1759

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/plotter-test.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions tools/plotter/start-server.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash
set -e

mkdir -p www/pkg

./build-wasm.sh

cd www
Expand Down
4 changes: 2 additions & 2 deletions tools/plotter/www/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tools/plotter/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading