Skip to content
Merged
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
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["18", "20", "22"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}

- name: Run tests
run: npm test

- name: Smoke β€” render the canonical examples
run: |
set -euo pipefail
node bin/plinth-sketch.js examples/plinth.sketch --check
node bin/plinth-sketch.js examples/three-tier.sketch --check
node bin/plinth-sketch.js examples/plinth.sketch -o /tmp/plinth.svg
test -s /tmp/plinth.svg
# Verify the rendered output begins with an <svg> tag and ends with </svg>
head -c 5 /tmp/plinth.svg | grep -q '<svg'
tail -c 6 /tmp/plinth.svg | grep -q '</svg>'

- name: Smoke β€” stdin β†’ stdout pipeline
run: |
printf '@layer T\na : Alpha\nb : Beta\na -> b\n' | node bin/plinth-sketch.js - > /tmp/stdin.svg
test -s /tmp/stdin.svg
head -c 5 /tmp/stdin.svg | grep -q '<svg'