From 9d5200b2f23499aeee18be12808e8436ee327dd3 Mon Sep 17 00:00:00 2001 From: Xarvex Date: Sat, 11 Jul 2026 01:29:11 -0500 Subject: [PATCH 1/3] fix(ci): path matching fixes, corrected concurrency Pull requests are now correctly handled and concurrency is per-job. translations branch can safely be ignored for pushes. --- .github/workflows/checks_python.yml | 63 +++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks_python.yml b/.github/workflows/checks_python.yml index 8b0e983f..6c9a1985 100644 --- a/.github/workflows/checks_python.yml +++ b/.github/workflows/checks_python.yml @@ -17,19 +17,20 @@ on: - uv.lock - '**.pyi?' push: + branches-ignore: + - translations paths: *on_paths workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - defaults: run: shell: sh jobs: run-conditions: + permissions: + pull-requests: read + name: Run Conditions runs-on: ubuntu-latest outputs: @@ -38,14 +39,25 @@ jobs: ruff: ${{ steps.run-conditions.outputs.ruff }} steps: - name: Checkout repository + if: github.event_name != 'pull_request' uses: actions/checkout@v7 with: - fetch-depth: 0 + # Largest positive number; infinite depth. + # Using 0 would grab all branches. + # See: https://github.com/actions/checkout/issues/520 + # See: https://stackoverflow.com/questions/6802145/how-to-convert-a-git-shallow-clone-to-a-full-clone/6802238#6802238 + # `git fetch --unshallow` as suggested in later answers would be an extra operation. + fetch-depth: '2147483647' - name: Check changed files id: changed-files uses: tj-actions/changed-files@v47.0.6 with: + fail_on_initial_diff_error: 'true' + fail_on_submodule_diff_error: 'true' + skip_initial_fetch: 'true' + + # WARNING: Does not support `?` glob operand! files_yaml: | generic: - .github/workflows/checks_python.yml @@ -65,14 +77,42 @@ jobs: - name: Set run conditions id: run-conditions + env: + CHANGED_GENERIC: ${{ steps.changed-files.outputs.generic_any_changed }} + CHANGED_PYRIGHT: ${{ steps.changed-files.outputs.pyright_any_changed }} + CHANGED_PYTEST: ${{ steps.changed-files.outputs.pytest_any_changed }} + CHANGED_RUFF: ${{ steps.changed-files.outputs.ruff_any_changed }} run: | + pyright=false + pytest=false + ruff=false + if [ "${CHANGED_GENERIC}" = true ]; then + pyright=true + pytest=true + ruff=true + else + if [ "${CHANGED_PYRIGHT}" = true ]; then + pyright=true + fi + if [ "${CHANGED_PYTEST}" = true ]; then + pytest=true + fi + if [ "${CHANGED_RUFF}" = true ]; then + ruff=true + fi + fi + cat <>"${GITHUB_OUTPUT}" - pyright=${{ steps.changed-files.outputs.generic_any_changed || steps.changed-files.outputs.pyright_any_changed }} - pytest=${{ steps.changed-files.outputs.generic_any_changed || steps.changed-files.outputs.pytest_any_changed }} - ruff=${{ steps.changed-files.outputs.generic_any_changed || steps.changed-files.outputs.ruff_any_changed }} + pyright=${pyright} + pytest=${pytest} + ruff=${ruff} EOF check-pyright: + concurrency: + group: pyright-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + name: Pyright needs: run-conditions if: needs.run-conditions.outputs.pyright == 'true' @@ -93,6 +133,9 @@ jobs: run: pyright check-pytest: + concurrency: + group: ${{ matrix.os }}-pytest-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true strategy: fail-fast: false matrix: @@ -155,6 +198,10 @@ jobs: run: pytest check-ruff: + concurrency: + group: ruff-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + name: Ruff needs: run-conditions if: needs.run-conditions.outputs.ruff == 'true' From 16cfa8d2ff37f9451162e2c57e3fbc8ea1d5172d Mon Sep 17 00:00:00 2001 From: Xarvex Date: Sat, 11 Jul 2026 19:27:21 -0500 Subject: [PATCH 2/3] chore(ci): ignore translations pushes for reuse --- .github/workflows/reuse.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index af710d93..a06909f2 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -3,7 +3,12 @@ --- name: REUSE Compliance Check -on: [pull_request, push] +on: + pull_request: + push: + branches-ignore: + - translations + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From aa2d9d4815b68a75267ee83ea836d26ab3c723bb Mon Sep 17 00:00:00 2001 From: Xarvex Date: Sat, 11 Jul 2026 19:33:12 -0500 Subject: [PATCH 3/3] fix(ci): misapplied rebase, cont 9d5200b fixes: #1445 (for good) --- .github/workflows/checks_python.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks_python.yml b/.github/workflows/checks_python.yml index 6c9a1985..23f71eb6 100644 --- a/.github/workflows/checks_python.yml +++ b/.github/workflows/checks_python.yml @@ -63,7 +63,8 @@ jobs: - .github/workflows/checks_python.yml - pyproject.toml - uv.lock - - '**.pyi?' + - '**.py' + - '**.pyi' pyright: - .github/actions/setup-python/action.yml pytest: