[ci] Add test workflow and gate releases on it - #1
Merged
Conversation
The repo had no CI: 114 tests only ever ran on a laptop, and release.yml went tag -> build -> publish with nothing in between. `python -m build` never imports the package, so an ImportError would have published fine. PyPI versions are immutable, so that mistake costs a version number. - ci.yml runs ruff + pytest on push and PR, macOS (the only supported platform), on 3.11 and 3.13 to bracket requires-python. - release.yml now needs a passing suite, and asserts the tag matches tailctl.__version__ before publishing. - pyproject reads the version from src/tailctl/__init__.py instead of duplicating it, so the two can no longer disagree. - checkout/setup-python bumped to v7, clearing the Node 20 deprecation. Solves: unverified release path, duplicated version string Tests: ruff + pytest green locally; python -m build produces 0.1.1 from the dynamic version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo had no CI. The 114-test suite only ever ran locally, and
release.ymlwent tag → build → publish with nothing in between — andpython -m buildnever imports the package, so anImportErrorwould have published cleanly. PyPI versions are immutable, so that mistake costs a version number permanently.Changes
ci.yml—ruff check+pyteston push to main and on PRs. macOS only (the sole supported platform), Python 3.11 and 3.13 to bracketrequires-python.release.yml— the publish job nowneeds:a passing suite, and asserts the pushed tag matchestailctl.__version__before anything reaches PyPI.pyproject.toml— version is nowdynamic, read fromsrc/tailctl/__init__.py. It was duplicated in both places with nothing checking they agreed.actions/checkoutandactions/setup-pythonbumped to v7, clearing the Node 20 deprecation warning on the 0.1.1 release run.Verification
ruff checkandpytest(114 passed) green locally;python -m buildproducestailctl-0.1.1from the dynamic version. This PR's own CI run is the real proof — that's why it's a PR rather than a push to main.