|
| 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 |
0 commit comments