From 0e7ca0bae9420a4a60520532cd472344fe752476 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Sun, 30 Aug 2026 01:13:36 -0600 Subject: [PATCH 1/4] Add a CI workflow running py_compile and the test suite Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/tests.yml | 27 +++++++++++++++++++++++++++ README.md | 5 +++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..3690925 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,27 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # the declared floor in README.md, and a current release + python-version: ["3.8", "3.13"] + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Compile both modules + run: python -m py_compile src/collide.py src/ideaCollisionGenerator.py + + - name: Run the test suite + run: python -m unittest discover -s tests -v diff --git a/README.md b/README.md index 8a258fd..6a6c34d 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,11 @@ python3 -m unittest discover -s tests Every prompt is patched, so no test waits on real input. +The same two commands — `py_compile` over both modules and the test suite — are +run on every push to `main` and on every pull request by +[`.github/workflows/tests.yml`](.github/workflows/tests.yml), against Python 3.8 +and 3.13. + ## License See [LICENSE](LICENSE). From 62d5deb0069645dd6aadab2717afb2661d935b3d Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Sun, 30 Aug 2026 01:14:50 -0600 Subject: [PATCH 2/4] Use action versions that run on Node 24 Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3690925..2bdfefc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,9 +14,9 @@ jobs: # the declared floor in README.md, and a current release python-version: ["3.8", "3.13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} From 3cc38ae6a1ff1207237cd7ae48d483cd00fb95ab Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Sun, 30 Aug 2026 01:16:00 -0600 Subject: [PATCH 3/4] Exercise the real stdin path in CI Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2bdfefc..81f799e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,3 +25,13 @@ jobs: - name: Run the test suite run: python -m unittest discover -s tests -v + + # the suite patches every prompt, so the real stdin path documented in + # README.md is exercised here instead + - name: Run the program end to end + run: | + printf 'k%s\n' 1 2 3 4 5 6 7 8 9 10 > fixture.txt + printf 'idea %s\n' 1 2 3 4 5 >> fixture.txt + python src/collide.py < fixture.txt + written=$(cat ideas/ideas-*.txt | wc -l) + test "$written" -eq 5 From f4c95c72ecca37f2b1d5e097a36409a827c5e1c7 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Sun, 30 Aug 2026 01:16:45 -0600 Subject: [PATCH 4/4] Describe all three CI steps in the README Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6a6c34d..0bd03ff 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,10 @@ python3 -m unittest discover -s tests Every prompt is patched, so no test waits on real input. -The same two commands — `py_compile` over both modules and the test suite — are -run on every push to `main` and on every pull request by -[`.github/workflows/tests.yml`](.github/workflows/tests.yml), against Python 3.8 -and 3.13. +[`.github/workflows/tests.yml`](.github/workflows/tests.yml) runs the same +commands on every push to `main` and on every pull request, against Python 3.8 +and 3.13: `py_compile` over both modules, the test suite, and one full run of +the program with a 15-line fixture on stdin. ## License