AUTOMATION / GITHUB ACTIONS
Check the model.
Keep the evidence.
Pin both tools to the same release. This workflow validates models, exports a diagram and retains it as a build artifact. Replace the model path with your own.
name: Check SysML models
on: [push, pull_request]
permissions:
contents: read
jobs:
models:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Validate models
run: npx --yes --package=sysml-validate@0.49.0 sysml-validate models/ --format github --strict
- name: Export model diagram
run: npx --yes --package=sysml-diagram@0.49.0 sysml-diagram export --file models/vehicle.sysml --view gv --out diagrams/vehicle.svg
- uses: actions/upload-artifact@v4
with:
name: sysml-diagrams
path: diagrams/
Interpret the result
sysml-validate exits with 0 for success, 1 for model errors (or warnings with --strict), and 2 for command or environment failures. Diagram export can still produce output when model diagnostics exist; use validation as the explicit quality gate.