From e7524398eed5af9295fd0dd5d37a5f486f54e048 Mon Sep 17 00:00:00 2001 From: Sythos Date: Sat, 5 Sep 2026 09:36:39 +0200 Subject: [PATCH 1/4] ci: add a Bun runtime compatibility workflow Runs the full build and test toolchain under Bun via "bun run --bun", which routes every npm script's "node ..." command through Bun's own Node-compatible runtime instead of a real Node.js binary. This is a one-shot check to see whether Bun can be documented as an alternative runtime; nothing else in the project depends on it yet. --- .github/workflows/bun-compat.yml | 83 ++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/bun-compat.yml diff --git a/.github/workflows/bun-compat.yml b/.github/workflows/bun-compat.yml new file mode 100644 index 0000000..9b62dd7 --- /dev/null +++ b/.github/workflows/bun-compat.yml @@ -0,0 +1,83 @@ +name: Bun runtime compatibility + +# Verifies that the whole build/test toolchain also runs unmodified under +# Bun, since every npm script here is a plain "node ..." command string. +# `bun run --bun` is what makes that a real test: it routes those "node" +# invocations through Bun's own Node-compatible runtime instead of silently +# falling back to a real Node.js binary, if one happened to be on PATH. +on: + pull_request: + push: + branches: + - main + - test-bun-runtime-compat + workflow_dispatch: + +permissions: + contents: read + +jobs: + bun: + name: Build and test under Bun + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Setup Bun + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + with: + bun-version: latest + + - name: Install dependencies with Bun + run: bun install + + - name: Run ESLint under Bun + run: bun run --bun lint + + - name: Compile TypeScript source and refresh JavaScript output + run: bun run --bun build:ts + + - name: Ensure generated JavaScript is synchronized + shell: bash + run: git diff --exit-code -- src/index.js src/js + + - name: Build browser bundles + run: bun run --bun build:bundle + + - name: Ensure browser bundles are synchronized + shell: bash + run: git diff --exit-code -- bundle + + - name: Run focused format tests + run: bun run --bun test:formats + + - name: Run core format tests + run: bun run --bun test:core + + - name: Run foundation module tests + run: bun run --bun test:foundations + + - name: Run bounded property-based barcode checks + run: bun run --bun test:fuzz + + - name: Test exact documentation URL assertions + run: bun run --bun test:docs + + - name: Run TypeScript compiler checks + run: bun run --bun types + + - name: Run public TypeScript declaration checks + run: bun run --bun types:api + + - name: Validate JavaScript and public package surface + run: bun .github/ci/validate-package.mjs + + - name: Verify zero runtime dependencies + run: bun tools/check-zero-deps.mjs + + - name: Validate documentation links and capability references + run: bun tools/check-docs.mjs From 4c9abfb13c3aeae50f9d547bec396c7bb23d07fe Mon Sep 17 00:00:00 2001 From: Sythos Date: Sat, 5 Sep 2026 09:38:47 +0200 Subject: [PATCH 2/4] ci: run the test suites via 'bun test' instead of shimming 'node --test' --- .github/workflows/bun-compat.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bun-compat.yml b/.github/workflows/bun-compat.yml index 9b62dd7..5a0bf0f 100644 --- a/.github/workflows/bun-compat.yml +++ b/.github/workflows/bun-compat.yml @@ -52,20 +52,25 @@ jobs: shell: bash run: git diff --exit-code -- bundle + # These use `bun test ` rather than `bun run --bun test:*`: Bun's + # node:test compatibility only activates its test-collection registry + # when the process itself is launched via the `bun test` subcommand, so + # shimming `node --test ` through `--bun` fails with "Cannot use + # test outside of the test runner" even though the files are unchanged. - name: Run focused format tests - run: bun run --bun test:formats + run: bun test test/maxicode.test.js test/databar-stacked.test.js test/databar-stacked-omnidirectional.test.js test/databar-limited.test.js test/databar-expanded.test.js test/telepen.test.js test/code25-code32.test.js test/fim.test.js test/plessey.test.js test/postal.test.js test/codablockf.test.js test/code16k.test.js test/dotcode.test.js test/hanxin.test.js test/gs1-composite.test.js test/kartrak.test.js test/postbar.test.js test/dxfilmedge.test.js test/jabcode.test.js test/payloads.test.js test/bundle.test.js - name: Run core format tests - run: bun run --bun test:core + run: bun test test/core.test.js test/image.test.js test/render.test.js test/oned.test.js test/oned-image-completion.test.js test/ean-addons.test.js test/binarizer-fallback.test.js test/camera-profile.test.js test/databar.tables.test.js test/databar.encoder.test.js test/databar.codec.test.js test/databar.gs1.test.js test/qr.test.js test/qr-family.integration.test.js test/datamatrix.test.js test/aztec-tables.test.js test/aztec-decoder.test.js test/aztecrune.tables.test.js test/aztecrune.encoder.test.js test/aztecrune.decoder.test.js test/aztecrune.detector.test.js test/aztecrune.blackbox.test.js test/pdf417.tables.test.js test/pdf417.encoder.test.js test/pdf417.compaction.test.js test/pdf417.binary-readiness.test.js test/pdf417.blackbox.test.js test/pdf417.detector.photo.test.js test/pdf417.device-evidence.test.js test/compactpdf417.test.js test/micropdf417.tables.test.js test/micropdf417.encoder.test.js test/micropdf417.compaction.test.js test/micropdf417.decoder.test.js test/micropdf417.detector.test.js test/micropdf417-api.test.js test/microqr.tables.test.js test/microqr.encoder.test.js test/microqr.decoder.test.js test/microqr.detector.test.js test/rmqr.test.js test/frameqr.tables.test.js test/frameqr.encoder.test.js test/frameqr.decoder.test.js test/frameqr.detector.test.js - name: Run foundation module tests - run: bun run --bun test:foundations + run: bun test test/foundation.test.js - name: Run bounded property-based barcode checks - run: bun run --bun test:fuzz + run: bun test test/fuzz/property.test.js - name: Test exact documentation URL assertions - run: bun run --bun test:docs + run: bun test tools/exact-url.test.mjs - name: Run TypeScript compiler checks run: bun run --bun types From dcd43663deeab903ccab8f983f5cc94fa660c391 Mon Sep 17 00:00:00 2001 From: Sythos Date: Sat, 5 Sep 2026 09:41:05 +0200 Subject: [PATCH 3/4] ci: give bun test a generous per-test timeout for the heavier LDPC and QR-growth tests --- .github/workflows/bun-compat.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bun-compat.yml b/.github/workflows/bun-compat.yml index 5a0bf0f..3bf27cd 100644 --- a/.github/workflows/bun-compat.yml +++ b/.github/workflows/bun-compat.yml @@ -58,19 +58,19 @@ jobs: # shimming `node --test ` through `--bun` fails with "Cannot use # test outside of the test runner" even though the files are unchanged. - name: Run focused format tests - run: bun test test/maxicode.test.js test/databar-stacked.test.js test/databar-stacked-omnidirectional.test.js test/databar-limited.test.js test/databar-expanded.test.js test/telepen.test.js test/code25-code32.test.js test/fim.test.js test/plessey.test.js test/postal.test.js test/codablockf.test.js test/code16k.test.js test/dotcode.test.js test/hanxin.test.js test/gs1-composite.test.js test/kartrak.test.js test/postbar.test.js test/dxfilmedge.test.js test/jabcode.test.js test/payloads.test.js test/bundle.test.js + run: bun test --timeout 30000 test/maxicode.test.js test/databar-stacked.test.js test/databar-stacked-omnidirectional.test.js test/databar-limited.test.js test/databar-expanded.test.js test/telepen.test.js test/code25-code32.test.js test/fim.test.js test/plessey.test.js test/postal.test.js test/codablockf.test.js test/code16k.test.js test/dotcode.test.js test/hanxin.test.js test/gs1-composite.test.js test/kartrak.test.js test/postbar.test.js test/dxfilmedge.test.js test/jabcode.test.js test/payloads.test.js test/bundle.test.js - name: Run core format tests - run: bun test test/core.test.js test/image.test.js test/render.test.js test/oned.test.js test/oned-image-completion.test.js test/ean-addons.test.js test/binarizer-fallback.test.js test/camera-profile.test.js test/databar.tables.test.js test/databar.encoder.test.js test/databar.codec.test.js test/databar.gs1.test.js test/qr.test.js test/qr-family.integration.test.js test/datamatrix.test.js test/aztec-tables.test.js test/aztec-decoder.test.js test/aztecrune.tables.test.js test/aztecrune.encoder.test.js test/aztecrune.decoder.test.js test/aztecrune.detector.test.js test/aztecrune.blackbox.test.js test/pdf417.tables.test.js test/pdf417.encoder.test.js test/pdf417.compaction.test.js test/pdf417.binary-readiness.test.js test/pdf417.blackbox.test.js test/pdf417.detector.photo.test.js test/pdf417.device-evidence.test.js test/compactpdf417.test.js test/micropdf417.tables.test.js test/micropdf417.encoder.test.js test/micropdf417.compaction.test.js test/micropdf417.decoder.test.js test/micropdf417.detector.test.js test/micropdf417-api.test.js test/microqr.tables.test.js test/microqr.encoder.test.js test/microqr.decoder.test.js test/microqr.detector.test.js test/rmqr.test.js test/frameqr.tables.test.js test/frameqr.encoder.test.js test/frameqr.decoder.test.js test/frameqr.detector.test.js + run: bun test --timeout 30000 test/core.test.js test/image.test.js test/render.test.js test/oned.test.js test/oned-image-completion.test.js test/ean-addons.test.js test/binarizer-fallback.test.js test/camera-profile.test.js test/databar.tables.test.js test/databar.encoder.test.js test/databar.codec.test.js test/databar.gs1.test.js test/qr.test.js test/qr-family.integration.test.js test/datamatrix.test.js test/aztec-tables.test.js test/aztec-decoder.test.js test/aztecrune.tables.test.js test/aztecrune.encoder.test.js test/aztecrune.decoder.test.js test/aztecrune.detector.test.js test/aztecrune.blackbox.test.js test/pdf417.tables.test.js test/pdf417.encoder.test.js test/pdf417.compaction.test.js test/pdf417.binary-readiness.test.js test/pdf417.blackbox.test.js test/pdf417.detector.photo.test.js test/pdf417.device-evidence.test.js test/compactpdf417.test.js test/micropdf417.tables.test.js test/micropdf417.encoder.test.js test/micropdf417.compaction.test.js test/micropdf417.decoder.test.js test/micropdf417.detector.test.js test/micropdf417-api.test.js test/microqr.tables.test.js test/microqr.encoder.test.js test/microqr.decoder.test.js test/microqr.detector.test.js test/rmqr.test.js test/frameqr.tables.test.js test/frameqr.encoder.test.js test/frameqr.decoder.test.js test/frameqr.detector.test.js - name: Run foundation module tests - run: bun test test/foundation.test.js + run: bun test --timeout 30000 test/foundation.test.js - name: Run bounded property-based barcode checks - run: bun test test/fuzz/property.test.js + run: bun test --timeout 30000 test/fuzz/property.test.js - name: Test exact documentation URL assertions - run: bun test tools/exact-url.test.mjs + run: bun test --timeout 30000 tools/exact-url.test.mjs - name: Run TypeScript compiler checks run: bun run --bun types From 88147c28ebd2dae95f94c53fe6fe6db87b9127bd Mon Sep 17 00:00:00 2001 From: Sythos Date: Sat, 5 Sep 2026 09:46:54 +0200 Subject: [PATCH 4/4] ci: raise bun test timeout further for the heaviest camera-profile tests --- .github/workflows/bun-compat.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bun-compat.yml b/.github/workflows/bun-compat.yml index 3bf27cd..d3221b4 100644 --- a/.github/workflows/bun-compat.yml +++ b/.github/workflows/bun-compat.yml @@ -58,19 +58,19 @@ jobs: # shimming `node --test ` through `--bun` fails with "Cannot use # test outside of the test runner" even though the files are unchanged. - name: Run focused format tests - run: bun test --timeout 30000 test/maxicode.test.js test/databar-stacked.test.js test/databar-stacked-omnidirectional.test.js test/databar-limited.test.js test/databar-expanded.test.js test/telepen.test.js test/code25-code32.test.js test/fim.test.js test/plessey.test.js test/postal.test.js test/codablockf.test.js test/code16k.test.js test/dotcode.test.js test/hanxin.test.js test/gs1-composite.test.js test/kartrak.test.js test/postbar.test.js test/dxfilmedge.test.js test/jabcode.test.js test/payloads.test.js test/bundle.test.js + run: bun test --timeout 120000 test/maxicode.test.js test/databar-stacked.test.js test/databar-stacked-omnidirectional.test.js test/databar-limited.test.js test/databar-expanded.test.js test/telepen.test.js test/code25-code32.test.js test/fim.test.js test/plessey.test.js test/postal.test.js test/codablockf.test.js test/code16k.test.js test/dotcode.test.js test/hanxin.test.js test/gs1-composite.test.js test/kartrak.test.js test/postbar.test.js test/dxfilmedge.test.js test/jabcode.test.js test/payloads.test.js test/bundle.test.js - name: Run core format tests - run: bun test --timeout 30000 test/core.test.js test/image.test.js test/render.test.js test/oned.test.js test/oned-image-completion.test.js test/ean-addons.test.js test/binarizer-fallback.test.js test/camera-profile.test.js test/databar.tables.test.js test/databar.encoder.test.js test/databar.codec.test.js test/databar.gs1.test.js test/qr.test.js test/qr-family.integration.test.js test/datamatrix.test.js test/aztec-tables.test.js test/aztec-decoder.test.js test/aztecrune.tables.test.js test/aztecrune.encoder.test.js test/aztecrune.decoder.test.js test/aztecrune.detector.test.js test/aztecrune.blackbox.test.js test/pdf417.tables.test.js test/pdf417.encoder.test.js test/pdf417.compaction.test.js test/pdf417.binary-readiness.test.js test/pdf417.blackbox.test.js test/pdf417.detector.photo.test.js test/pdf417.device-evidence.test.js test/compactpdf417.test.js test/micropdf417.tables.test.js test/micropdf417.encoder.test.js test/micropdf417.compaction.test.js test/micropdf417.decoder.test.js test/micropdf417.detector.test.js test/micropdf417-api.test.js test/microqr.tables.test.js test/microqr.encoder.test.js test/microqr.decoder.test.js test/microqr.detector.test.js test/rmqr.test.js test/frameqr.tables.test.js test/frameqr.encoder.test.js test/frameqr.decoder.test.js test/frameqr.detector.test.js + run: bun test --timeout 120000 test/core.test.js test/image.test.js test/render.test.js test/oned.test.js test/oned-image-completion.test.js test/ean-addons.test.js test/binarizer-fallback.test.js test/camera-profile.test.js test/databar.tables.test.js test/databar.encoder.test.js test/databar.codec.test.js test/databar.gs1.test.js test/qr.test.js test/qr-family.integration.test.js test/datamatrix.test.js test/aztec-tables.test.js test/aztec-decoder.test.js test/aztecrune.tables.test.js test/aztecrune.encoder.test.js test/aztecrune.decoder.test.js test/aztecrune.detector.test.js test/aztecrune.blackbox.test.js test/pdf417.tables.test.js test/pdf417.encoder.test.js test/pdf417.compaction.test.js test/pdf417.binary-readiness.test.js test/pdf417.blackbox.test.js test/pdf417.detector.photo.test.js test/pdf417.device-evidence.test.js test/compactpdf417.test.js test/micropdf417.tables.test.js test/micropdf417.encoder.test.js test/micropdf417.compaction.test.js test/micropdf417.decoder.test.js test/micropdf417.detector.test.js test/micropdf417-api.test.js test/microqr.tables.test.js test/microqr.encoder.test.js test/microqr.decoder.test.js test/microqr.detector.test.js test/rmqr.test.js test/frameqr.tables.test.js test/frameqr.encoder.test.js test/frameqr.decoder.test.js test/frameqr.detector.test.js - name: Run foundation module tests - run: bun test --timeout 30000 test/foundation.test.js + run: bun test --timeout 120000 test/foundation.test.js - name: Run bounded property-based barcode checks - run: bun test --timeout 30000 test/fuzz/property.test.js + run: bun test --timeout 120000 test/fuzz/property.test.js - name: Test exact documentation URL assertions - run: bun test --timeout 30000 tools/exact-url.test.mjs + run: bun test --timeout 120000 tools/exact-url.test.mjs - name: Run TypeScript compiler checks run: bun run --bun types