Skip to content

Commit 5785e43

Browse files
ci: add CI OK aggregator gate (#20)
Remove paths-ignore from CI triggers so the workflow always fires on PRs. Add dorny/paths-filter@v4 to detect code vs docs-only changes. Gate all jobs behind the path-filter output. Add final 'ok' job that aggregates all results into a single required check.
1 parent f369ced commit 5785e43

1 file changed

Lines changed: 45 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ name: CI
33
on:
44
push:
55
branches: [main]
6-
paths-ignore:
7-
- '**/*.md'
86
pull_request:
97
branches: [main]
10-
paths-ignore:
11-
- '**/*.md'
128

139
concurrency:
1410
group: fluxgraph-ci-${{ github.ref }}
@@ -18,8 +14,26 @@ env:
1814
VCPKG_COMMIT: "66c0373dc7fca549e5803087b9487edfe3aca0a1"
1915

2016
jobs:
17+
changes:
18+
name: Detect code changes
19+
runs-on: ubuntu-24.04
20+
permissions:
21+
pull-requests: read
22+
outputs:
23+
code: ${{ steps.filter.outputs.code }}
24+
steps:
25+
- uses: actions/checkout@v6
26+
- uses: dorny/paths-filter@v4
27+
id: filter
28+
with:
29+
filters: |
30+
code:
31+
- '!(**/*.md)'
32+
2133
python-lint:
2234
name: Python Linting (ruff)
35+
needs: [changes]
36+
if: needs.changes.outputs.code == 'true'
2337
runs-on: ubuntu-24.04
2438
timeout-minutes: 10
2539

@@ -48,6 +62,8 @@ jobs:
4862
4963
python-typecheck:
5064
name: Python Type Checking (mypy)
65+
needs: [changes]
66+
if: needs.changes.outputs.code == 'true'
5167
runs-on: ubuntu-24.04
5268
timeout-minutes: 10
5369

@@ -74,6 +90,8 @@ jobs:
7490

7591
linux-matrix:
7692
name: Linux ${{ matrix.lane }}
93+
needs: [changes]
94+
if: needs.changes.outputs.code == 'true'
7795
runs-on: ubuntu-24.04
7896
strategy:
7997
fail-fast: false
@@ -148,6 +166,8 @@ jobs:
148166

149167
strict-dimensional-validation:
150168
name: Strict dimensional validation
169+
needs: [changes]
170+
if: needs.changes.outputs.code == 'true'
151171
runs-on: ubuntu-24.04
152172
timeout-minutes: 30
153173

@@ -187,6 +207,8 @@ jobs:
187207

188208
windows-core:
189209
name: Windows core-only
210+
needs: [changes]
211+
if: needs.changes.outputs.code == 'true'
190212
runs-on: windows-2025
191213

192214
steps:
@@ -210,6 +232,8 @@ jobs:
210232

211233
windows-diagram:
212234
name: Windows diagram-dot
235+
needs: [changes]
236+
if: needs.changes.outputs.code == 'true'
213237
runs-on: windows-2025
214238

215239
steps:
@@ -233,6 +257,8 @@ jobs:
233257

234258
diagram-render-smoke:
235259
name: Diagram Render Smoke
260+
needs: [changes]
261+
if: needs.changes.outputs.code == 'true'
236262
runs-on: ubuntu-24.04
237263

238264
steps:
@@ -265,7 +291,22 @@ jobs:
265291
test -s "$OUT"
266292
267293
version-sync:
294+
needs: [changes]
295+
if: needs.changes.outputs.code == 'true'
268296
uses: anolishq/.github/.github/workflows/version-sync.yml@01b61259e549666b145d941a5aa8a851b98ec399 # main
269297
with:
270298
python-version: '3.12'
271299
working-directory: '.'
300+
301+
ok:
302+
name: ok
303+
if: always()
304+
needs: [changes, python-lint, python-typecheck, linux-matrix, strict-dimensional-validation, windows-core, windows-diagram, diagram-render-smoke, version-sync]
305+
runs-on: ubuntu-24.04
306+
timeout-minutes: 5
307+
steps:
308+
- name: Fail if any upstream job failed or was cancelled
309+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
310+
run: exit 1
311+
- name: Pass
312+
run: echo 'All checks passed or were skipped'

0 commit comments

Comments
 (0)