Skip to content

Commit 9185c7a

Browse files
committed
ci: expand full matrix triggers
Signed-off-by: Georg Heiler <georg.kf.heiler@gmail.com>
1 parent 1472847 commit 9185c7a

4 files changed

Lines changed: 131 additions & 16 deletions

File tree

.github/workflows/cd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
uses: ./.github/workflows/checks.yml
1212
with:
1313
push_coverage: false
14+
force_all_checks: true
15+
run_package_compat: true
16+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
1417
pre-release-check:
1518
runs-on: ubuntu-latest
1619
outputs:

.github/workflows/checks.yml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ on:
99
type: boolean
1010
description: "If true, run the full lint job in this workflow."
1111
default: true
12+
force_all_checks:
13+
type: boolean
14+
description: "If true, run all test/example/package lanes regardless of changed-path filters."
15+
default: false
16+
run_package_compat:
17+
type: boolean
18+
description: "If true, run the cross-version package compatibility lanes."
19+
default: false
20+
python_versions:
21+
type: string
22+
description: 'JSON array of Python versions to use for multi-version jobs, e.g. ["3.10", "3.12"].'
23+
default: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
1224
secrets:
1325
CODECOV_TOKEN:
1426
required: false
@@ -33,15 +45,25 @@ jobs:
3345
contents: read
3446
pull-requests: read
3547
outputs:
36-
run_tests: ${{ steps.filter.outputs.run_tests }}
37-
run_examples: ${{ steps.filter.outputs.run_examples }}
38-
run_package: ${{ steps.filter.outputs.run_package }}
48+
run_tests: ${{ steps.force.outputs.run_tests || steps.filter.outputs.run_tests }}
49+
run_examples: ${{ steps.force.outputs.run_examples || steps.filter.outputs.run_examples }}
50+
run_package: ${{ steps.force.outputs.run_package || steps.filter.outputs.run_package }}
3951
steps:
52+
- name: Force all lanes
53+
if: ${{ inputs.force_all_checks }}
54+
id: force
55+
run: |
56+
echo "run_tests=true" >> "$GITHUB_OUTPUT"
57+
echo "run_examples=true" >> "$GITHUB_OUTPUT"
58+
echo "run_package=true" >> "$GITHUB_OUTPUT"
59+
4060
- uses: actions/checkout@v6
61+
if: ${{ !inputs.force_all_checks }}
4162
with:
4263
fetch-depth: 0
4364

4465
- name: Detect changed paths
66+
if: ${{ !inputs.force_all_checks }}
4567
id: filter
4668
uses: dorny/paths-filter@v3
4769
with:
@@ -113,7 +135,7 @@ jobs:
113135
strategy:
114136
fail-fast: false
115137
matrix:
116-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
138+
python-version: ${{ fromJSON(inputs.python_versions) }}
117139
steps:
118140
- uses: actions/checkout@v6
119141

@@ -182,7 +204,7 @@ jobs:
182204
strategy:
183205
fail-fast: false
184206
matrix:
185-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
207+
python-version: ${{ fromJSON(inputs.python_versions) }}
186208
steps:
187209
- uses: actions/checkout@v6
188210

@@ -256,7 +278,7 @@ jobs:
256278
strategy:
257279
fail-fast: false
258280
matrix:
259-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
281+
python-version: ${{ fromJSON(inputs.python_versions) }}
260282
steps:
261283
- uses: actions/checkout@v6
262284

@@ -344,17 +366,19 @@ jobs:
344366

345367
test-pip-install-no-lock:
346368
needs: changes
347-
if: ${{ needs.changes.outputs.run_package == 'true' }}
369+
if: ${{ inputs.run_package_compat && needs.changes.outputs.run_package == 'true' }}
348370
runs-on: ubuntu-latest
371+
env:
372+
SELECTED_PYTHON_VERSIONS: ${{ join(fromJSON(inputs.python_versions), ' ') }}
349373
steps:
350374
- uses: actions/checkout@v5
351375

352376
- name: Install uv
353377
uses: astral-sh/setup-uv@v6
354378

355-
- name: Test pip install across Python versions
379+
- name: Test pip install across selected Python versions
356380
run: |
357-
for py_version in 3.10 3.11 3.12 3.13 3.14; do
381+
for py_version in $SELECTED_PYTHON_VERSIONS; do
358382
echo "=========================================="
359383
echo "Testing Python $py_version"
360384
echo "=========================================="
@@ -379,17 +403,19 @@ jobs:
379403
380404
test-pip-install-no-dev-headers:
381405
needs: changes
382-
if: ${{ needs.changes.outputs.run_package == 'true' }}
406+
if: ${{ inputs.run_package_compat && needs.changes.outputs.run_package == 'true' }}
383407
runs-on: ubuntu-latest
408+
env:
409+
SELECTED_PYTHON_VERSIONS: ${{ join(fromJSON(inputs.python_versions), ' ') }}
384410
steps:
385411
- uses: actions/checkout@v5
386412

387413
- name: Install uv
388414
uses: astral-sh/setup-uv@v6
389415

390-
- name: Test pip install without dev headers across Python versions
416+
- name: Test pip install without dev headers across selected Python versions
391417
run: |
392-
for py_version in 3.10 3.11 3.12 3.13 3.14; do
418+
for py_version in $SELECTED_PYTHON_VERSIONS; do
393419
echo "=========================================="
394420
echo "Testing Python $py_version (no dev headers)"
395421
echo "=========================================="

.github/workflows/ci-main.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Run CI Main"
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
schedule:
8+
- cron: "17 3 * * *"
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
code-checks:
16+
uses: ./.github/workflows/checks.yml
17+
with:
18+
run_lint: true
19+
force_all_checks: true
20+
run_package_compat: true
21+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
22+
secrets:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci.yml

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ name: "Run CI"
22

33
on:
44
pull_request:
5-
types: [opened, reopened, synchronize]
5+
types: [opened, reopened, synchronize, labeled, unlabeled]
66
push:
77
branches:
88
- "**"
99
- "!main"
1010
- "!gh-pages"
11+
workflow_dispatch:
12+
inputs:
13+
python_versions:
14+
description: 'JSON array of Python versions to run, e.g. ["3.10"] or ["3.10", "3.12", "3.14"].'
15+
required: true
16+
default: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
17+
type: string
1118

1219
concurrency:
1320
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -20,13 +27,21 @@ jobs:
2027
contents: read
2128
pull-requests: read
2229
outputs:
23-
run_ci: ${{ steps.filter.outputs.run_ci }}
30+
run_ci: ${{ steps.manual.outputs.run_ci || steps.filter.outputs.run_ci }}
31+
full_matrix_override: ${{ steps.filter.outputs.full_matrix_override }}
2432
steps:
33+
- name: Mark manual runs to execute CI
34+
if: ${{ github.event_name == 'workflow_dispatch' }}
35+
id: manual
36+
run: echo "run_ci=true" >> "$GITHUB_OUTPUT"
37+
2538
- uses: actions/checkout@v6
39+
if: ${{ github.event_name != 'workflow_dispatch' }}
2640
with:
2741
fetch-depth: 0
2842

2943
- name: Detect changed paths
44+
if: ${{ github.event_name != 'workflow_dispatch' }}
3045
id: filter
3146
uses: dorny/paths-filter@v3
3247
with:
@@ -45,12 +60,60 @@ jobs:
4560
- "docling/**"
4661
- "tests/**"
4762
- "docs/examples/**"
63+
full_matrix_override:
64+
- ".github/workflows/ci.yml"
65+
- ".github/workflows/checks.yml"
66+
- "pyproject.toml"
67+
- "uv.lock"
68+
- "README.md"
69+
- "LICENSE"
4870
4971
code-checks:
5072
needs: changes
51-
if: ${{ needs.changes.outputs.run_ci == 'true' && (github.event_name == 'push' || (github.event.pull_request.head.repo.full_name != 'docling-project/docling' && github.event.pull_request.head.repo.full_name != 'docling-project/docling')) }}
73+
if: >-
74+
${{
75+
needs.changes.outputs.run_ci == 'true' &&
76+
(
77+
github.event_name == 'workflow_dispatch' ||
78+
github.event_name == 'push' ||
79+
(
80+
github.event_name == 'pull_request' &&
81+
(
82+
github.event.pull_request.head.repo.full_name != github.repository ||
83+
contains(github.event.pull_request.labels.*.name, 'tests:full')
84+
)
85+
)
86+
)
87+
}}
5288
uses: ./.github/workflows/checks.yml
5389
with:
54-
run_lint: ${{ github.event_name == 'push' }}
90+
run_lint: ${{ github.event_name != 'pull_request' }}
91+
force_all_checks: ${{ github.event_name == 'workflow_dispatch' }}
92+
run_package_compat: >-
93+
${{
94+
github.event_name == 'workflow_dispatch' ||
95+
needs.changes.outputs.full_matrix_override == 'true' ||
96+
(
97+
github.event_name == 'pull_request' &&
98+
contains(github.event.pull_request.labels.*.name, 'tests:full')
99+
)
100+
}}
101+
python_versions: >-
102+
${{
103+
(
104+
github.event_name == 'workflow_dispatch' &&
105+
inputs.python_versions
106+
) ||
107+
(
108+
needs.changes.outputs.full_matrix_override == 'true' &&
109+
'["3.10", "3.11", "3.12", "3.13", "3.14"]'
110+
) ||
111+
(
112+
github.event_name == 'pull_request' &&
113+
contains(github.event.pull_request.labels.*.name, 'tests:full') &&
114+
'["3.10", "3.11", "3.12", "3.13", "3.14"]'
115+
) ||
116+
'["3.10"]'
117+
}}
55118
secrets:
56119
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)