Skip to content

Commit 9ffcd96

Browse files
authored
chore: drop area/ prefix and skip CI jobs by path (#84)
* chore(labels): drop area/ prefix from PR labeler * ci: skip backend test jobs when paths don't match
1 parent 1169e32 commit 9ffcd96

2 files changed

Lines changed: 69 additions & 14 deletions

File tree

.github/labeler.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
1-
# Path-based PR auto-labels. Drives triage, filtering, and release-notes
2-
# grouping. Each area label is additive — a PR touching Rust + docs gets
3-
# both `area/rust` and `area/docs`.
4-
5-
area/rust:
1+
rust:
62
- changed-files:
73
- any-glob-to-any-file:
84
- "crates/**"
95
- "Cargo.toml"
106
- "Cargo.lock"
117

12-
area/python:
8+
python:
139
- changed-files:
1410
- any-glob-to-any-file:
1511
- "py_src/**"
1612
- "pyproject.toml"
1713
- "uv.lock"
1814

19-
area/dashboard:
15+
dashboard:
2016
- changed-files:
2117
- any-glob-to-any-file:
2218
- "dashboard/**"
2319

24-
area/docs:
20+
docs:
2521
- changed-files:
2622
- any-glob-to-any-file:
2723
- "docs/**"
2824
- "README.md"
2925
- "CHANGELOG.md"
3026
- "**/*.md"
3127

32-
area/tests:
28+
tests:
3329
- changed-files:
3430
- any-glob-to-any-file:
3531
- "tests/**"
@@ -38,23 +34,23 @@ area/tests:
3834
- "**/*.test.ts"
3935
- "**/*.test.tsx"
4036

41-
area/ci:
37+
ci:
4238
- changed-files:
4339
- any-glob-to-any-file:
4440
- ".github/**"
4541
- ".pre-commit-config.yaml"
4642

47-
area/storage:
43+
storage:
4844
- changed-files:
4945
- any-glob-to-any-file:
5046
- "crates/taskito-core/src/storage/**"
5147

52-
area/scheduler:
48+
scheduler:
5349
- changed-files:
5450
- any-glob-to-any-file:
5551
- "crates/taskito-core/src/scheduler/**"
5652

57-
area/workflows:
53+
workflows:
5854
- changed-files:
5955
- any-glob-to-any-file:
6056
- "crates/taskito-core/src/workflow*/**"

.github/workflows/ci.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,37 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14+
changes:
15+
name: Detect changed paths
16+
runs-on: ubuntu-latest
17+
outputs:
18+
rust: ${{ steps.filter.outputs.rust }}
19+
python: ${{ steps.filter.outputs.python }}
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v6
23+
24+
- name: Filter paths
25+
id: filter
26+
uses: dorny/paths-filter@v3
27+
with:
28+
filters: |
29+
rust:
30+
- 'crates/**'
31+
- 'Cargo.toml'
32+
- 'Cargo.lock'
33+
- 'rust-toolchain.toml'
34+
- '.github/workflows/ci.yml'
35+
python:
36+
- 'py_src/**'
37+
- 'tests/python/**'
38+
- 'pyproject.toml'
39+
- 'uv.lock'
40+
- 'crates/**'
41+
- 'Cargo.toml'
42+
- 'Cargo.lock'
43+
- '.github/workflows/ci.yml'
44+
1445
lint:
1546
name: Lint & Static Analysis
1647
runs-on: ubuntu-latest
@@ -57,6 +88,8 @@ jobs:
5788

5889
rust-test:
5990
name: Rust Tests (SQLite)
91+
needs: changes
92+
if: needs.changes.outputs.rust == 'true' || github.event_name == 'push'
6093
runs-on: ubuntu-latest
6194
steps:
6295
- name: Check out repository
@@ -85,6 +118,8 @@ jobs:
85118

86119
rust-test-postgres:
87120
name: Rust Tests (PostgreSQL)
121+
needs: changes
122+
if: needs.changes.outputs.rust == 'true' || github.event_name == 'push'
88123
runs-on: ubuntu-latest
89124
services:
90125
postgres:
@@ -125,6 +160,8 @@ jobs:
125160

126161
rust-test-redis:
127162
name: Rust Tests (Redis)
163+
needs: changes
164+
if: needs.changes.outputs.rust == 'true' || github.event_name == 'push'
128165
runs-on: ubuntu-latest
129166
services:
130167
redis:
@@ -161,7 +198,8 @@ jobs:
161198

162199
test:
163200
name: Python Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
164-
needs: lint
201+
needs: [lint, changes]
202+
if: needs.changes.outputs.python == 'true' || github.event_name == 'push'
165203
runs-on: ${{ matrix.os }}
166204
strategy:
167205
matrix:
@@ -229,3 +267,24 @@ jobs:
229267
fi
230268
exit $PYTEST_EXIT
231269
shell: bash
270+
271+
ci-status:
272+
name: CI status
273+
if: always()
274+
needs: [lint, rust-test, rust-test-postgres, rust-test-redis, test]
275+
runs-on: ubuntu-latest
276+
steps:
277+
- name: Check that no required job failed
278+
run: |
279+
results='${{ toJson(needs) }}'
280+
echo "$results"
281+
fail=$(echo "$results" | python3 -c "
282+
import json, sys
283+
data = json.load(sys.stdin)
284+
bad = [k for k, v in data.items() if v['result'] not in ('success', 'skipped')]
285+
print(','.join(bad))
286+
")
287+
if [ -n "$fail" ]; then
288+
echo "::error::Failing or cancelled jobs: $fail"
289+
exit 1
290+
fi

0 commit comments

Comments
 (0)