From 946d2cbaf48edfd4bdae615b8752c67fb53f6ea1 Mon Sep 17 00:00:00 2001 From: HEROgold Date: Sun, 15 Feb 2026 11:47:59 +0100 Subject: [PATCH 1/3] Optimize workflows, utilizing caching and better workflows --- .github/workflows/coverage.yml | 4 +-- .github/workflows/docs.yml | 5 +++- .github/workflows/pypi.yml | 49 ++++++++++++---------------------- .github/workflows/test.yml | 26 +++++++++++------- 4 files changed, 39 insertions(+), 45 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f32468e..e850639 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,9 +18,9 @@ jobs: - uses: actions/checkout@v4 - name: Install uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v7 with: - version: "latest" + enable-cache: true - name: Set up Python 3.13 run: uv python install 3.13 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d593661..859ac0b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,7 +18,10 @@ jobs: with: python-version: '3.12' - - uses: astral-sh/setup-uv@v3 + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true - name: Generate docs (pdoc + mkdocs) run: | diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 4d1362e..1144bea 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -9,47 +9,32 @@ permissions: contents: read jobs: - build: - name: Build distribution 📦 - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install pypa/build - run: >- - python3 -m - pip install - uv - - name: Build a binary wheel and a source tarball - run: uv build --sdist --wheel --out-dir dist - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions - path: dist/ - publish-to-pypi: name: Publish Python 🐍 distribution 📦 to PyPI - needs: - - build runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/confkit permissions: id-token: write # IMPORTANT: mandatory for trusted publishing + contents: read steps: - - name: Download all the dists - uses: actions/download-artifact@v4 + - name: Checkout + uses: actions/checkout@v4 with: - name: python-package-distributions - path: dist/ + persist-credentials: false + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + + - name: Set up Python + run: uv python install 3.14 + + - name: Build distribution 📦 + run: uv build + - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + run: uv publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7aa9866..86a7aa1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ permissions: contents: read jobs: - test: + check-cache: runs-on: ubuntu-latest strategy: matrix: @@ -33,28 +33,34 @@ jobs: restore-keys: | ${{ runner.os }}-pytest-${{ matrix.python-version }}- + test: + runs-on: ubuntu-latest + needs: check-cache + if: needs.check-cache.outputs.cache-hit != 'true' + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - name: Install uv - if: steps.cache-pytest.outputs.cache-hit != 'true' - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v7 with: - version: "latest" + enable-cache: true - name: Set up Python ${{ matrix.python-version }} - if: steps.cache-pytest.outputs.cache-hit != 'true' run: uv python install ${{ matrix.python-version }} - name: Install dependencies - if: steps.cache-pytest.outputs.cache-hit != 'true' run: uv sync --group dev - name: Run tests - if: steps.cache-pytest.outputs.cache-hit != 'true' run: uv run pytest . - name: Run ruff check - if: steps.cache-pytest.outputs.cache-hit != 'true' run: uv run ruff check . - name: Run type checking - if: steps.cache-pytest.outputs.cache-hit != 'true' - run: uvx ty check . --ignore no-matching-overload + run: uv run ty check . --ignore no-matching-overload From c82aeb2e8de1f98ee8af94ee51bd01f35bd47604 Mon Sep 17 00:00:00 2001 From: HEROgold Date: Sun, 15 Feb 2026 11:56:58 +0100 Subject: [PATCH 2/3] use uvx to auto-install ty for this workflow. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86a7aa1..bc184b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,4 +63,4 @@ jobs: run: uv run ruff check . - name: Run type checking - run: uv run ty check . --ignore no-matching-overload + run: uvx ty check . --ignore no-matching-overload From 3c5f452ae61290f897eb25be95f2078115fe3404 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 15 Feb 2026 12:05:43 +0100 Subject: [PATCH 3/3] Fix workflow cache-hit condition referencing non-existent job outputs (#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> --- .github/workflows/test.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc184b6..2c0e581 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ permissions: contents: read jobs: - check-cache: + test: runs-on: ubuntu-latest strategy: matrix: @@ -33,18 +33,6 @@ jobs: restore-keys: | ${{ runner.os }}-pytest-${{ matrix.python-version }}- - test: - runs-on: ubuntu-latest - needs: check-cache - if: needs.check-cache.outputs.cache-hit != 'true' - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] - fail-fast: false - - steps: - - uses: actions/checkout@v4 - - name: Install uv uses: astral-sh/setup-uv@v7 with: