From e86bfd33ffde4fee91334dcf4307d10132a497ca Mon Sep 17 00:00:00 2001 From: GitBib <15717621+GitBib@users.noreply.github.com> Date: Sun, 2 Aug 2026 14:20:55 +0300 Subject: [PATCH 1/2] ci: pin uv, disable fail-fast, add job timeouts, drop dead conditions - prune-cache: true restores the pre-v9 setup-uv behaviour. v9.0.0 flipped the default to false, and enable-cache is on in all four workflows, so the Actions cache would grow until LRU eviction starts thrashing a 15-job matrix. - fail-fast: false on both matrices. One failing job used to cancel the other 14, which made every red run look platform-agnostic and hid whether a failure was specific to one OS or Python version. - version: "0.12.1" instead of latest. A new uv release could break CI with no change in the repo, and the failure would look like ours. - timeout-minutes on every job. The default is 360, so a hung installer burns six hours of runner time. - dropped if: clauses referencing events the workflows never receive: workflow_dispatch in Tests, pull_request in Docs. --- .github/workflows/prek.yml | 1 + .github/workflows/python-docs.yml | 7 ++++--- .github/workflows/python-publish.yml | 4 +++- .github/workflows/python-tests.yml | 12 +++++++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index 135aaed..ff5e35e 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -4,6 +4,7 @@ on: [push, pull_request] jobs: prek: runs-on: ubuntu-latest + timeout-minutes: 10 steps: - uses: actions/checkout@v7.0.1 - uses: j178/prek-action@v2.0.3 diff --git a/.github/workflows/python-docs.yml b/.github/workflows/python-docs.yml index 4fab058..55d3dd6 100644 --- a/.github/workflows/python-docs.yml +++ b/.github/workflows/python-docs.yml @@ -12,7 +12,7 @@ permissions: jobs: docs: runs-on: ubuntu-latest - if: github.event_name == 'push' || !github.event.pull_request.draft + timeout-minutes: 15 steps: - name: Check out repository uses: actions/checkout@v7.0.1 @@ -21,9 +21,10 @@ jobs: id: setup-uv uses: astral-sh/setup-uv@v9.0.0 with: - version: latest + version: "0.12.1" python-version: "3.14" enable-cache: true + prune-cache: true - name: Install project run: uv sync --all-extras --dev @@ -34,7 +35,7 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v4.1.0 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' }} with: publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0a3080c..75751fc 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -11,6 +11,7 @@ permissions: jobs: deploy: runs-on: ubuntu-latest + timeout-minutes: 15 if: github.event_name == 'release' steps: - name: Check out repository @@ -29,9 +30,10 @@ jobs: id: setup-uv uses: astral-sh/setup-uv@v9.0.0 with: - version: latest + version: "0.12.1" python-version: "3.14" enable-cache: true + prune-cache: true - name: Install project run: uv sync --all-extras --dev diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 7fc77f8..730156e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -18,10 +18,12 @@ permissions: jobs: run: strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] runs-on: ${{ matrix.os }} + timeout-minutes: 30 steps: - name: Check out repository uses: actions/checkout@v7.0.1 @@ -64,9 +66,10 @@ jobs: id: setup-uv uses: astral-sh/setup-uv@v9.0.0 with: - version: latest + version: "0.12.1" python-version: ${{ matrix.python-version }} enable-cache: true + prune-cache: true - name: Install project run: uv sync --all-extras --dev @@ -77,7 +80,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v6.0.0 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'pull_request' }} with: env_vars: OS,PYTHON files: ./coverage.xml @@ -94,7 +97,9 @@ jobs: runtime-import: name: Runtime-only import smoke test runs-on: ubuntu-latest + timeout-minutes: 10 strategy: + fail-fast: false matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: @@ -104,9 +109,10 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v9.0.0 with: - version: latest + version: "0.12.1" python-version: ${{ matrix.python-version }} enable-cache: true + prune-cache: true - name: Import pymkv without dev dependencies run: uv run --no-dev python -c "import pymkv" From 4cf631b8409a68dc232877b91dd67b7e36b24f9f Mon Sep 17 00:00:00 2001 From: GitBib <15717621+GitBib@users.noreply.github.com> Date: Sun, 2 Aug 2026 14:21:42 +0300 Subject: [PATCH 2/2] ci: publish docs only from master workflow_dispatch can be started on any branch, so gating the deploy on the event name let a manual run from a feature branch publish to gh-pages. Gate on the ref instead. The build still runs on dispatch from any branch, it just does not publish. --- .github/workflows/python-docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-docs.yml b/.github/workflows/python-docs.yml index 55d3dd6..9bd5458 100644 --- a/.github/workflows/python-docs.yml +++ b/.github/workflows/python-docs.yml @@ -35,7 +35,9 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v4.1.0 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' }} + # Publish only from master. workflow_dispatch can be started on any + # branch, so gate on the ref rather than on the event. + if: ${{ github.ref == 'refs/heads/master' }} with: publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }}