krz/nfogen

A scene-style ASCII .nfo generator.

clone: git clone https://gitbay.org/krz/nfogen.git

af9a9d92129b53ce2ff86963e79a3f55f39bc2f2

verified · cmc

author: Christian Cleberg <hello@cleberg.net> · 2026-08-23T01:35:27Z

Check the examples regenerate, and point dependabot at something real

The examples are a golden fixture: each .toml sits beside the .nfo it produces,
so regenerating and diffing catches an unintended change to layout, banner or
encoding in review rather than in a release.

dependabot was configured for the uv ecosystem, but nfogen is a single stdlib
script with no manifest, so it tracked nothing and opened no PRs. Actions are
the only thing here with versions, and now there are actions to track.
 .github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..bf08ef8
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,42 @@
+name: Test
+
+# nfogen ships examples/*.toml next to the .nfo each one produces, which makes
+# them a golden fixture: regenerate and compare. A change to layout, banner or
+# encoding that was not intended shows up as a diff in a committed file rather
+# than in someone's release notes.
+on:
+  pull_request:
+  push:
+    branches: [main]
+
+permissions:
+  contents: read
+
+jobs:
+  examples:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v7
+
+      # 3.11+ for tomllib, which nfogen needs to read a .toml config at all.
+      - uses: actions/setup-python@v7
+        with:
+          python-version: '3.13'
+
+      - name: Syntax
+        run: python -m compileall -q nfogen.py
+
+      - name: Examples regenerate byte for byte
+        run: |
+          set -euo pipefail
+          fail=0
+          for toml in examples/*.toml; do
+            base="$(basename "$toml" .toml)"
+            [ -f "examples/$base.nfo" ] || continue
+            python nfogen.py -c "$toml" -o "/tmp/$base.nfo" --no-input
+            if ! diff -u "examples/$base.nfo" "/tmp/$base.nfo"; then
+              echo "::error file=examples/$base.nfo::regenerated output differs from the committed example"
+              fail=1
+            fi
+          done
+          exit "$fail"