Skip to content

ci: run tests on push and pull request#14

Merged
dmccoystephenson merged 2 commits into
mainfrom
feature/ci-test-workflow
Jul 21, 2026
Merged

ci: run tests on push and pull request#14
dmccoystephenson merged 2 commits into
mainfrom
feature/ci-test-workflow

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • Adds .github/workflows/test.yml: compiles graphik.py, runs an import smoke test, and runs the headless pytest suite (SDL_VIDEODRIVER=dummy) on every push to main and every pull request.
  • Adds a test optional-dependency group (pytest) to pyproject.toml so CI installs test tooling via pip install -e .[test] instead of a hardcoded pip install pytest line.

Why

The repo has a robust pytest suite (src/test/python/..., 14 tests) and a tag-triggered publish.yml, but no workflow runs on ordinary pushes/PRs — regressions were only caught by manual local validation (py_compile + pytest), which this dev-loop cycle already runs by hand every PR. This gives the same signal automatically and to human reviewers/other contributors.

Scope note

Issue #5 ("Package graphik for proper release & distribution") is intentionally not touched by this PR. Its remaining steps — claiming the graphik name on PyPI (a manual maintainer account action) and migrating downstream consumers (Roam, Apex, Ophidian, Patchwork, Tic-Tak-Toe) off vendored copies (cross-repo follow-ups) — are both outside what this loop can do unilaterally in this repo, per the issue's own latest comment. Left open, no action taken this cycle.

Test plan

  • python3 -m py_compile src/main/python/preponderous/graphik/graphik.py
  • python3 -c "import preponderous.graphik as g; print(g.__version__)"
  • python3 -m pytest -q → 14 passed
  • Reviewed test.yml against publish.yml's existing conventions (permissions: contents: read, actions/checkout@v4, actions/setup-python@v5)

Only a tag-triggered publish workflow existed; there was no CI signal
on ordinary pushes/PRs, so regressions relied entirely on manual local
validation. Add a test workflow that compiles, import-smoke-tests, and
runs the headless pytest suite, and declare pytest as a test extra so
CI installs it via the package's own metadata.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric:

  • Scope: PASS — only .github/workflows/test.yml (new) and a 3-line [project.optional-dependencies] addition to pyproject.toml are touched; both are necessary for the CI workflow, nothing unrelated.
  • Tests-new: N/A — this is a CI/build-config change, not a new public method on Graphik; no new test surface is introduced.
  • Tests-fix: N/A — not a bug fix, so there is nothing to stash-and-run.
  • Sibling structure: PASS — test.yml mirrors publish.yml's existing conventions: header comment explaining purpose, minimal permissions: contents: read, actions/checkout@v4, actions/setup-python@v5.
  • Sibling renames: N/A — no identifiers renamed.
  • Docs: PASS — grepped README.md/RELEASING.md for CI/workflow mentions; neither claims "no CI exists" or otherwise goes stale from this change, so no doc update needed.
  • Issue resolution: N/A — no tracking issue for this gap (found during Phase 1 triage); no Closes #N claimed.
  • manual validation: PASS — re-ran on the PR head just now: py_compile succeeds, import smoke test prints 0.2.0, pytest -q → 14 passed.

Repo-specific:

  • camelCase: N/A — no new Graphik method added.
  • Backward-compat: PASS — no existing public member of Graphik touched.
  • Headless: PASS — the new workflow sets SDL_VIDEODRIVER=dummy / SDL_AUDIODRIVER=dummy before running pytest, same as local validation and conftest.py.
  • Version sync: N/A — no version string changed.
  • No new deps: PASS — pytest is added only under [project.optional-dependencies].test, not dependencies; the runtime dependency set (pygame) and README's "Dependencies" list are unaffected.

Summary: adds the missing push/PR test signal (only a tag-triggered publish workflow existed before); no production code touched, all rubric items pass or are N/A for this change type. Issue #5 (packaging/release) is deliberately not addressed here — its remaining steps are a manual PyPI account action and cross-repo consumer migrations, both outside this PR's scope; noted in the PR body.

@dmccoystephenson

Copy link
Copy Markdown
Member Author

Independent review pass (inline, via the review skill — no external reviewer available in this dispatch):

Overview: Adds .github/workflows/test.yml (compile + import smoke test + headless pytest on push/PR) and a test optional-dependency group in pyproject.toml. Fills the gap that only a tag-triggered publish.yml existed before.

Findings: No blocking issues.

  • Follows publish.yml's existing conventions (minimal permissions: contents: read, actions/checkout@v4, actions/setup-python@v5).
  • Headless env vars match conftest.py's pattern.
  • Security: read-only token, no secrets referenced, appropriate for pull_request (not pull_request_target).
  • Non-blocking polish ideas for a future PR, not required here: a Python version matrix to actually exercise the declared requires-python = ">=3.8" range (currently only latest 3.x runs), cache: pip on setup-python for speed, and a concurrency group to cancel superseded runs.

No changes requested. Manual validation remains green (py_compile, import smoke test, pytest 14/14).

python-version: "3.x" resolves to the latest interpreter (3.14 on the
runner), but pygame 2.6.1 only ships prebuilt wheels through cp313.
Installing on 3.14 forced pip to build pygame from source, which failed
because the runner lacks SDL/freetype dev headers (sdl-config not found).
Pinning to 3.13 uses the existing prebuilt wheel instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review: fixed CI failure by pinning python-version to 3.13 (pygame has no cp314 wheel yet). Verified locally with pytest -q (14 passed); Compile and test check on this PR is now green. Filed #15 for the same latent issue in publish.yml (out of scope here).

@dmccoystephenson
dmccoystephenson merged commit f9c052e into main Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant