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
.github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) new file mode 100644 @@ -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"