Skip to content

Optimize workflows, utilizing caching and better workflows#45

Merged
HEROgold merged 3 commits intomasterfrom
workflows
Feb 15, 2026
Merged

Optimize workflows, utilizing caching and better workflows#45
HEROgold merged 3 commits intomasterfrom
workflows

Conversation

@HEROgold
Copy link
Owner

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s GitHub Actions workflows to “optimize” CI by upgrading setup-uv usage and attempting to add caching/conditional execution to reduce repeated work.

Changes:

  • Introduces a new cache-check job in the Test workflow intended to skip running the test matrix when a cache hit occurs.
  • Updates multiple workflows to use astral-sh/setup-uv@v7 with enable-cache: true.
  • Simplifies the PyPI workflow to build and publish directly with uv.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/test.yml Adds a check-cache job and gates the test job on a cache-hit condition; upgrades setup-uv and adjusts commands.
.github/workflows/pypi.yml Removes separate build/artifact steps; builds and publishes using uv in a single job.
.github/workflows/docs.yml Upgrades setup-uv to v7 and enables uv caching.
.github/workflows/coverage.yml Upgrades setup-uv to v7 and enables uv caching.

Comment on lines 17 to 35
@@ -33,28 +33,34 @@ jobs:
restore-keys: |
${{ runner.os }}-pytest-${{ matrix.python-version }}-

Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow now runs a full matrix check-cache job that only restores .pytest_cache but never runs pytest, so it can't populate/update the cache. Additionally, .pytest_cache isn't a reliable artifact to skip running tests/lint/type-checks in CI. Consider removing the separate cache-check job and instead cache uv deps and pytest cache within the test job to speed up runs while still executing the checks.

Copilot uses AI. Check for mistakes.
Comment on lines 65 to 66
- name: Run type checking
if: steps.cache-pytest.outputs.cache-hit != 'true'
run: uvx ty check . --ignore no-matching-overload
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv run ty check requires the ty package to be installed in the environment, but uv sync --group dev does not include ty in pyproject.toml dependency groups. This will fail at runtime; either add ty to the dev dependency group or revert to uvx ty ... (or another installation approach) so the command is available.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +43
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test matrix includes Python 3.10 even though pyproject.toml declares requires-python = ">=3.11", so CI on 3.10 will fail or be misleading. Also consider whether 3.14 is intentionally supported/available on runners; if not, pin the matrix to supported stable versions (3.11+).

Copilot uses AI. Check for mistakes.
enable-cache: true

- name: Set up Python
run: uv python install 3.14
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow pins the build environment to Python 3.14 via uv python install 3.14, which may be unavailable/unstable on GitHub runners and isn't required by requires-python (>=3.11). Prefer a stable version you support (e.g., 3.12 or 3.13) for building and publishing.

Suggested change
run: uv python install 3.14
run: uv python install 3.12

Copilot uses AI. Check for mistakes.

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
run: uv publish
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow switched from pypa/gh-action-pypi-publish (which handles trusted publishing) to uv publish, but no API token/environment variables are configured. If uv publish isn't configured for OIDC/trusted publishing in this repo, this step will fail to authenticate. Either keep the trusted-publishing action or document/configure the required auth mechanism for uv publish (token env var or OIDC support).

Suggested change
run: uv publish
uses: pypa/gh-action-pypi-publish@release/v1

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +40
test:
runs-on: ubuntu-latest
needs: check-cache
if: needs.check-cache.outputs.cache-hit != 'true'
strategy:
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test job condition references needs.check-cache.outputs.cache-hit, but check-cache does not define any job outputs. As written, this condition will never reflect the cache action result (likely evaluating to true every time), so the extra check-cache matrix runs for no benefit. Expose cache-hit as a job output (via outputs:) or remove this job and do cache restore/check within test.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Feb 15, 2026

@HEROgold I've opened a new pull request, #48, to work on those changes. Once the pull request is ready, I'll request review from you.

…#48)

* Initial plan

* Remove check-cache job and consolidate cache into test job

Co-authored-by: HEROgold <21345384+HEROgold@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: HEROgold <21345384+HEROgold@users.noreply.github.com>
@HEROgold HEROgold merged commit 42a6114 into master Feb 15, 2026
8 checks passed
@HEROgold HEROgold deleted the workflows branch February 15, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants