zpl-regression-gate

Test ZPL labels in CI with local deterministic semantic and visual regression checks


Keywords
zpl, zpl-testing, zebra, zebra-labels, label, visual-regression, snapshot-testing, label-testing, barcode-testing, github-actions, continuous-integration, ci
License
MIT
Install
npm install zpl-regression-gate@0.2.1

Documentation

ZPL Regression Gate

Catch unintended Zebra Programming Language label changes before they reach a warehouse or printer queue. The gate runs locally or in CI, stores approved semantic and PNG baselines in the repository, and fails on changed fields, barcodes, coordinates, font commands, dimensions, diagnostics, or rendered pixels.

View ZPL Regression Gate on GitHub Marketplace

This is an early behavioral-validation release. It is not a physical-printer conformance certificate. Firmware, resident fonts, downloaded assets, media, darkness, calibration, and device state can change physical output.

Quick start

Requires Node.js 22 or later.

npm install --save-dev zpl-regression-gate
npx zpl-gate update
git add zpl-gate.config.json zpl-baselines
npx zpl-gate check

Create zpl-gate.config.json:

{
  "files": ["labels/shipping.zpl", "labels/inventory.zpl"],
  "baselineDir": "zpl-baselines",
  "artifactDir": "zpl-gate-artifacts",
  "printDensity": 8
}

update is the explicit baseline-approval operation. check never creates a missing baseline silently. On regression it exits with status 1 and writes the current render, visual diff, and report.json to the artifact directory. Source and rendered labels remain on the local machine or CI runner.

GitHub Actions

name: ZPL labels
on: [push, pull_request]
jobs:
  labels:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Markloev/zpl-regression-gate@v0.1.0
        with:
          config: zpl-gate.config.json

Pin the release's full commit SHA rather than its tag in consequential production workflows.

Current boundary

The free local gate validates repository-owned ZPL fixtures without uploading label data. It deliberately does not promise every ZPL command or physical printer behavior. Command coverage is included in report.json; unsupported or partially modeled behavior should be treated explicitly rather than hidden.

See MARKET-VALIDATION.md for the predeclared discoverability and monetization test. No paid tier is available yet.