Refactor CI/CD workflows and consolidate test execution - #156
Merged
Conversation
The check job ran pre-commit with every hook, including the local test hook, so the suite ran seven times per pull request: once under 3.13 with coverage there and once more in each leg of the matrix. Nothing cancelled superseded runs either, so three pushes to a branch kept 24 jobs alive. - Skip the test hook in the check job and move the coverage run, with the credentials it needs for the integration tests, into the 3.13 leg of the matrix, which now owns testing - Cancel superseded pull request runs, leaving master runs alone since they gate the release - Fold the changelog job into check, which spent a whole runner on a grep - Install uv with astral-sh/setup-uv, replacing the curl install and the explicit cache steps, and keep a cache per Python version - Bound every job with timeout-minutes, they defaulted to six hours - Narrow the workflow permissions to the contents read that checkout needs The release workflow looked for a tag named v<version> while it creates <version>, and its shallow checkout fetched no tags to look at, so the guard against releasing an existing version never fired. It now checks refs/tags/<version> with the full history, and builds with uv build instead of installing build with pip under a separate Python. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwt5Ey1txWtHnhN5bonYy5
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.
Summary
This PR refactors the GitHub Actions workflows to improve efficiency, maintainability, and clarity. The main changes consolidate the check and changelog jobs, reorganize test execution to run once per Python version with credentials only where needed, and modernize tooling setup.
Key Changes
Workflow Structure (
check.yml)changelogandcheckjobs into a singlecheckjob that runs all checks sequentiallypull-requests: readtocontents: readfor proper access controlTest Execution (
check.ymlandtest.yml)testjob that runs independently across Python versions 3.9-3.14SKIP: testenvironment variable to the check job to avoid running tests twiceTooling Updates
curlinstallation withastral-sh/setup-uvaction (v10.0.1) for both check and test jobsenable-cacheandcache-dependency-globoptionscache-suffixto ensure each Python version has its own cache entryRelease Workflow (
release.yml)python -m buildwithuv buildfor faster, more efficient package buildinggit rev-parse -q --verify "refs/tags/..."which correctly matches the actual tag name being createdfetch-depth: 0to checkout step to ensure tags are available for the tag existence checkNotable Implementation Details
if: github.event_name == 'pull_request') rather than at the job levelhttps://claude.ai/code/session_01Qwt5Ey1txWtHnhN5bonYy5