Skip to content

Commit 283e03d

Browse files
Try unified CI job with smart pathing
1 parent 01ebc32 commit 283e03d

4 files changed

Lines changed: 129 additions & 79 deletions

File tree

.github/workflows/builds.yml

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,10 @@
11
name: Builds
22

3+
# Driven by .github/workflows/ci.yml. PR and push-to-main triggers live in
4+
# the parent so a single "CI" check gates every PR regardless of paths.
35
on:
4-
push:
5-
branches: ["main"]
6-
paths:
7-
- src/**
8-
- include/**
9-
- cpp-example-collection/**
10-
- bridge/**
11-
- client-sdk-rust/**
12-
- cmake/**
13-
- scripts/**
14-
- CMakeLists.txt
15-
- build.sh
16-
- build.cmd
17-
- .build-info.json.in
18-
- vcpkg.json
19-
- CMakePresets.json
20-
- docker/Dockerfile.base
21-
- docker/Dockerfile.sdk
22-
- .github/workflows/**
23-
- .clang-format
24-
- scripts/clang-format.sh
25-
pull_request:
26-
branches: ["main"]
27-
paths:
28-
- src/**
29-
- include/**
30-
- cpp-example-collection/**
31-
- bridge/**
32-
- client-sdk-rust/**
33-
- cmake/**
34-
- scripts/**
35-
- CMakeLists.txt
36-
- build.sh
37-
- build.cmd
38-
- .build-info.json.in
39-
- vcpkg.json
40-
- CMakePresets.json
41-
- docker/Dockerfile.base
42-
- docker/Dockerfile.sdk
43-
- .github/workflows/**
44-
- .clang-format
45-
- scripts/clang-format.sh
46-
workflow_dispatch:
6+
workflow_call: {}
7+
workflow_dispatch: {}
478

489
permissions:
4910
contents: read

.github/workflows/ci.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
# Aggregator workflow that fans out to every PR-gating workflow as a single,
4+
# always-running check. Configure branch protection to require only the "CI"
5+
# status; downstream workflows will run automatically. This avoids the
6+
# previous footgun where path-filtered workflows skipped entire PRs (so all
7+
# checks showed "passing" without ever executing — see #147).
8+
#
9+
# Each child workflow is conditionally invoked based on the paths a PR
10+
# touched, mirroring the path filters that used to live in each child.
11+
# Children that get skipped via `if:` count as "skipped" in the CI rollup
12+
# (not "failed"), so the parent "CI" status reaches SUCCESS and branch
13+
# protection is satisfied. Push-to-main and manual dispatch always run
14+
# everything regardless of changed paths.
15+
16+
on:
17+
workflow_dispatch:
18+
pull_request:
19+
types: [opened, reopened, synchronize, ready_for_review]
20+
branches: ["main"]
21+
push:
22+
branches: ["main"]
23+
24+
concurrency:
25+
group: ci-${{ github.ref }}
26+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
# Compute once which path groups changed; every other job references these
33+
# outputs. dorny/paths-filter handles PR base diff, push base diff, and
34+
# empty results on non-diff events (workflow_dispatch); the `if:` guards
35+
# below explicitly opt non-PR events back into running everything.
36+
changes:
37+
name: Detect changes
38+
runs-on: ubuntu-latest
39+
outputs:
40+
builds: ${{ steps.filter.outputs.builds }}
41+
tests: ${{ steps.filter.outputs.tests }}
42+
docs: ${{ steps.filter.outputs.docs }}
43+
steps:
44+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
45+
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3.0.3
46+
id: filter
47+
with:
48+
filters: |
49+
builds:
50+
- src/**
51+
- include/**
52+
- cpp-example-collection/**
53+
- bridge/**
54+
- client-sdk-rust/**
55+
- cmake/**
56+
- scripts/**
57+
- CMakeLists.txt
58+
- build.sh
59+
- build.cmd
60+
- .build-info.json.in
61+
- vcpkg.json
62+
- CMakePresets.json
63+
- docker/Dockerfile.base
64+
- docker/Dockerfile.sdk
65+
- .clang-format
66+
- .github/workflows/ci.yml
67+
- .github/workflows/builds.yml
68+
tests:
69+
- src/**
70+
- include/**
71+
- client-sdk-rust/**
72+
- CMakeLists.txt
73+
- CMakePresets.json
74+
- build.sh
75+
- build.cmd
76+
- vcpkg.json
77+
- .token_helpers/**
78+
- .github/workflows/ci.yml
79+
- .github/workflows/tests.yml
80+
docs:
81+
- **/*.md
82+
- include/**
83+
- src/**
84+
- docs/**
85+
- scripts/generate-docs.sh
86+
- .github/workflows/ci.yml
87+
- .github/workflows/generate-docs.yml
88+
- .github/workflows/publish-docs.yml
89+
90+
builds:
91+
name: Builds
92+
needs: changes
93+
if: ${{ needs.changes.outputs.builds == 'true' || github.event_name != 'pull_request' }}
94+
uses: ./.github/workflows/builds.yml
95+
secrets: inherit
96+
97+
tests:
98+
name: Tests
99+
needs: changes
100+
if: ${{ needs.changes.outputs.tests == 'true' || github.event_name != 'pull_request' }}
101+
uses: ./.github/workflows/tests.yml
102+
secrets: inherit
103+
104+
# license-check and pin-check are cheap (seconds) and have no meaningful
105+
# path scope (any source change can affect license headers; any action
106+
# bump can affect pinning), so they always run.
107+
license-check:
108+
name: License Check
109+
uses: ./.github/workflows/license_check.yml
110+
111+
pin-check:
112+
name: Pin Check
113+
uses: ./.github/workflows/pin_check.yml
114+
115+
generate-docs:
116+
name: Generate Docs
117+
needs: changes
118+
if: ${{ needs.changes.outputs.docs == 'true' || github.event_name != 'pull_request' }}
119+
uses: ./.github/workflows/generate-docs.yml

.github/workflows/generate-docs.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,9 @@ permissions:
1010
# The artifact is attached to the workflow run so reviewers can download a preview,
1111
# but also to verify the documentation artifact is valid for subsequent release runs
1212
# that will publish them to the LiveKit docs web page: https://docs.livekit.io/reference/client-sdk-cpp/
13+
# Driven by .github/workflows/ci.yml on PRs. PR trigger lives in the parent
14+
# so a single "CI" check gates every PR regardless of paths.
1315
on:
14-
pull_request:
15-
branches: ["main"]
16-
paths:
17-
- include/**
18-
- src/**
19-
- docs/**
20-
- scripts/generate-docs.sh
21-
- .github/workflows/generate-docs.yml
22-
- .github/workflows/publish-docs.yml
2316
workflow_call:
2417
inputs:
2518
version:

.github/workflows/tests.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
11
name: Tests
22

3+
# Driven by .github/workflows/ci.yml. PR and push-to-main triggers live in
4+
# the parent so a single "CI" check gates every PR regardless of paths.
35
on:
4-
push:
5-
branches: ["main"]
6-
paths:
7-
- src/**
8-
- include/**
9-
- client-sdk-rust/**
10-
- CMakeLists.txt
11-
- CMakePresets.json
12-
- build.sh
13-
- build.cmd
14-
- vcpkg.json
15-
- .token_helpers/**
16-
- .github/workflows/tests.yml
17-
pull_request:
18-
branches: ["main"]
19-
paths:
20-
- src/**
21-
- include/**
22-
- client-sdk-rust/**
23-
- CMakeLists.txt
24-
- CMakePresets.json
25-
- build.sh
26-
- build.cmd
27-
- vcpkg.json
28-
- .token_helpers/**
29-
- .github/workflows/tests.yml
30-
workflow_dispatch:
6+
workflow_call: {}
7+
workflow_dispatch: {}
318

329
permissions:
3310
contents: read

0 commit comments

Comments
 (0)