From 0ff08951c8883c46b9d8134fa66cc1764cdf6d3b Mon Sep 17 00:00:00 2001 From: "Rost S." <63606118+NeoZorK@users.noreply.github.com> Date: Wed, 18 Nov 2026 19:37:54 +0200 Subject: [PATCH 1/2] ci: test a pull request once, one macOS Python per PR (all weekly), concurrency and timeouts Signed-off-by: Rost S. <63606118+NeoZorK@users.noreply.github.com> --- .github/workflows/tests.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2f4a237c2..84d14d663 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,9 +1,18 @@ name: tests on: + # A pull request is tested once (not again for its branch push); main and release tags are tested on push. push: + branches: [main] + tags: ["v*"] pull_request: workflow_dispatch: + schedule: + - cron: "17 4 * * 1" # weekly: the full matrix, including every macOS Python version + +concurrency: + group: tests-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read @@ -16,6 +25,9 @@ jobs: # The first two job names are required status checks of the branch ruleset; keep them # exactly as they are. The others are informational. name: ${{ matrix.job }} + # The macOS runners are the scarce ones: a pull request runs one macOS Python version, the weekly run all of them. + if: ${{ !matrix.weekly || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -55,10 +67,12 @@ jobs: pytest_args: "-q" - job: "pytest-extra (macos-latest, python 3.11)" os: macos-latest + weekly: true python: "3.11" pytest_args: "-n auto -q" - job: "pytest-extra (macos-latest, python 3.15)" os: macos-latest + weekly: true python: "3.15" pytest_args: "-n auto -q" - job: "pytest-extra (ubuntu-latest, python 3.13)" @@ -104,6 +118,7 @@ jobs: # The core is held at 100% line and branch coverage on every platform; the other platform's lock module is # excluded by its own pragma. name: core coverage (${{ matrix.os }}) + timeout-minutes: 30 strategy: fail-fast: false matrix: From 65885fd6f8ca12f0caffde2665ec86c9a00e1697 Mon Sep 17 00:00:00 2001 From: "Rost S." <63606118+NeoZorK@users.noreply.github.com> Date: Wed, 18 Nov 2026 20:27:09 +0200 Subject: [PATCH 2/2] ci: fix the workflow (matrix is not allowed in a job-level if): a separate weekly job for the extra macOS versions Signed-off-by: Rost S. <63606118+NeoZorK@users.noreply.github.com> --- .github/workflows/tests.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84d14d663..2984427f6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,8 +25,6 @@ jobs: # The first two job names are required status checks of the branch ruleset; keep them # exactly as they are. The others are informational. name: ${{ matrix.job }} - # The macOS runners are the scarce ones: a pull request runs one macOS Python version, the weekly run all of them. - if: ${{ !matrix.weekly || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} timeout-minutes: 30 strategy: fail-fast: false @@ -65,16 +63,6 @@ jobs: os: windows-latest python: "3.15" pytest_args: "-q" - - job: "pytest-extra (macos-latest, python 3.11)" - os: macos-latest - weekly: true - python: "3.11" - pytest_args: "-n auto -q" - - job: "pytest-extra (macos-latest, python 3.15)" - os: macos-latest - weekly: true - python: "3.15" - pytest_args: "-n auto -q" - job: "pytest-extra (ubuntu-latest, python 3.13)" os: ubuntu-latest python: "3.13" @@ -114,6 +102,25 @@ jobs: if: steps.pytest.outcome == 'failure' run: exit 1 + pytest-macos-weekly: + # The macOS runners are the scarce ones: a pull request runs one macOS Python version (pytest-extra, python 3.12 above) + # and the core coverage job; the other macOS versions run here, in the weekly scheduled run or on demand. + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + name: pytest-extra (macos-latest, python ${{ matrix.python }}) + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + python: ["3.11", "3.15"] + runs-on: macos-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 + - run: uv sync --extra dev --python ${{ matrix.python }} + - run: uv run protocolith doctor + - run: uv run protocolith validate-all + - run: uv run --extra dev pytest -n auto -q + core-coverage: # The core is held at 100% line and branch coverage on every platform; the other platform's lock module is # excluded by its own pragma.