diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8cc419b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: test + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm install + - run: npm run test:all + # the built artifacts are committed (the demo pages load them) — fail if a + # change to src/ or tools/ was pushed without rebuilding dist/ + - run: npm run build + - run: git diff --exit-code -- dist diff --git a/README.md b/README.md index 5d2811d..98519f2 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ each facet derives its own normal so the shading is flat. ## Minified build -`dist/tinywebgpu.min.js` — **15.7 KB** (7.7 KB gzipped), versus 91 KB for the source. Rebuild it with +`dist/tinywebgpu.min.js` — **15.5 KB** (7.4 KB gzipped), versus 91 KB for the source. Rebuild it with `npm run build:min` (esbuild is the only dev dependency; consumers still install nothing). It is a **production artifact and it is silent**: every `console` warning is stripped, and so are @@ -306,10 +306,10 @@ accident. ## Tiny build (inline / on-chain embedding) When the library has to be *inlined* — a single self-contained HTML file, an on-chain generative -artwork with a hard byte budget — 15.7 KB of it is still mostly features you are not using. A +artwork with a hard byte budget — 15.5 KB of it is still mostly features you are not using. A procedural piece renders from a shader and never touches image loading, readback, or PNG export. -`npm run build:tiny` produces **`dist/tinywebgpu.tiny.js` — 8.8 KB** (4.6 KB gzipped) by dropping +`npm run build:tiny` produces **`dist/tinywebgpu.tiny.js` — 8.5 KB** (4.5 KB gzipped) by dropping every optional entry point, and adding `--iife --no-banner` gets a classic `