Skip to content

Commit 2b9eb2a

Browse files
feat(ci): split code quality into 4 parallel jobs
Split the single prek job into parallel jobs: - pre-commit-hooks: lightweight hooks (SKIP=poe-check) - package-checks: fmt/lint/pyright/mypy via check-packages - samples-markdown: samples-lint, samples-syntax, markdown-code-lint - mypy: change-detected mypy checks All 4 jobs run concurrently (×2 Python versions = 8 runners).
1 parent db0354a commit 2b9eb2a

1 file changed

Lines changed: 67 additions & 4 deletions

File tree

.github/workflows/python-code-quality.yml

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ env:
1212
UV_CACHE_DIR: /tmp/.uv-cache
1313

1414
jobs:
15-
prek:
16-
name: Prek Checks
15+
pre-commit-hooks:
16+
name: Pre-commit Hooks
1717
if: "!cancelled()"
1818
strategy:
1919
fail-fast: false
@@ -37,17 +37,80 @@ jobs:
3737
python-version: ${{ matrix.python-version }}
3838
os: ${{ runner.os }}
3939
env:
40-
# Configure a constant location for the uv cache
4140
UV_CACHE_DIR: /tmp/.uv-cache
4241
- uses: actions/cache@v5
4342
with:
4443
path: ~/.cache/prek
4544
key: prek|${{ matrix.python-version }}|${{ hashFiles('python/.pre-commit-config.yaml') }}
4645
- uses: j178/prek-action@v1
47-
name: Run Prek Hooks
46+
name: Run Pre-commit Hooks (excluding poe-check)
47+
env:
48+
SKIP: poe-check
4849
with:
4950
extra-args: --cd python --all-files
5051

52+
package-checks:
53+
name: Package Checks
54+
if: "!cancelled()"
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
python-version: ["3.10", "3.14"]
59+
runs-on: ubuntu-latest
60+
continue-on-error: true
61+
defaults:
62+
run:
63+
working-directory: ./python
64+
env:
65+
UV_PYTHON: ${{ matrix.python-version }}
66+
steps:
67+
- uses: actions/checkout@v6
68+
with:
69+
fetch-depth: 0
70+
- name: Set up python and install the project
71+
id: python-setup
72+
uses: ./.github/actions/python-setup
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
os: ${{ runner.os }}
76+
env:
77+
UV_CACHE_DIR: /tmp/.uv-cache
78+
- name: Run fmt, lint, pyright in parallel across packages
79+
run: uv run poe check-packages
80+
81+
samples-markdown:
82+
name: Samples & Markdown
83+
if: "!cancelled()"
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
python-version: ["3.10", "3.14"]
88+
runs-on: ubuntu-latest
89+
continue-on-error: true
90+
defaults:
91+
run:
92+
working-directory: ./python
93+
env:
94+
UV_PYTHON: ${{ matrix.python-version }}
95+
steps:
96+
- uses: actions/checkout@v6
97+
with:
98+
fetch-depth: 0
99+
- name: Set up python and install the project
100+
id: python-setup
101+
uses: ./.github/actions/python-setup
102+
with:
103+
python-version: ${{ matrix.python-version }}
104+
os: ${{ runner.os }}
105+
env:
106+
UV_CACHE_DIR: /tmp/.uv-cache
107+
- name: Run samples lint
108+
run: uv run poe samples-lint
109+
- name: Run samples syntax check
110+
run: uv run poe samples-syntax
111+
- name: Run markdown code lint
112+
run: uv run poe markdown-code-lint
113+
51114
mypy:
52115
name: Mypy Checks
53116
if: "!cancelled()"

0 commit comments

Comments
 (0)