-
Notifications
You must be signed in to change notification settings - Fork 28
Unified CI workflow for smarter PR gating #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
283e03d
Try unified CI job with smart pathing
alan-george-lk b970698
Fix perms
alan-george-lk 4a540ab
Fix syntax
alan-george-lk 52d8bff
Fix
alan-george-lk cc7bae7
See if we improved anything
alan-george-lk 16b9eed
Merge branch 'main' of github.com:livekit/client-sdk-cpp into feature…
alan-george-lk 919b1fe
Rm old bridge ref
alan-george-lk 47a8f6c
Fix duplicate job
alan-george-lk bcb5bf0
Better paths-filter
alan-george-lk b438371
Merge branch 'main' into feature/unified_ci
alan-george-lk 0172a2a
Try smarter FFI cache
alan-george-lk 8c8530b
Merge branch 'feature/unified_ci' of github.com:livekit/client-sdk-cp…
alan-george-lk aebaa8b
Whitespace to trigger second run for cache test
alan-george-lk 4461e5e
Remove sccache, free disk space on docker runs
alan-george-lk 76c421b
try windows cacheing
alan-george-lk f6ec3a2
Merge branch 'main' into feature/unified_ci
alan-george-lk 02fb0c4
Everything is CI
alan-george-lk f0650bb
Additional cache attempt
alan-george-lk fdcd1da
Cleanup CI
alan-george-lk 7f938ca
Try vcpkg caching
alan-george-lk 2bad7a8
Whitespace for another CI run
alan-george-lk a97b4b2
Try better windows cache
alan-george-lk e70feaf
Try better linux cache
alan-george-lk 77146ca
Move quality checks out of builds
alan-george-lk 47973fa
Agents.md stuff
alan-george-lk 90ac6f8
Try whitespace change to skip CI
alan-george-lk 9f96422
Attempt to catch mac crash
alan-george-lk bbdfe5f
Try sccache again??
alan-george-lk 36cc1c6
Try sccache again
alan-george-lk 80eab1e
Repeat test with proper tracing
alan-george-lk 61e6df3
Another try
alan-george-lk 4290a40
Cleanup
alan-george-lk 6b7bc20
Merge branch 'main' into feature/unified_ci
alan-george-lk 7771a06
Cleanup, change quality to cpp checks in case we want to move it out
alan-george-lk 6c8a3a9
Merge branch 'feature/unified_ci' of github.com:livekit/client-sdk-cp…
alan-george-lk 00bb2af
Additional cleanup
alan-george-lk 565c976
Required checks
alan-george-lk 1de20e3
Remove pin check, PR feedback
alan-george-lk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize, ready_for_review] | ||
| branches: ["main"] | ||
| push: | ||
| branches: ["main"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
| packages: read | ||
|
|
||
| jobs: | ||
| # Compute once which path groups changed; every other job references these | ||
| # outputs. dorny/paths-filter handles PR base diff, push base diff, and | ||
| # empty results on non-diff events (workflow_dispatch); the `if:` guards | ||
| # below explicitly opt manual runs back into running everything. | ||
| changes: | ||
| name: Detect Changes | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| builds: ${{ steps.filter.outputs.builds }} | ||
| tests: ${{ steps.filter.outputs.tests }} | ||
| docs: ${{ steps.filter.outputs.docs }} | ||
| cpp_checks: ${{ steps.filter.outputs.cpp_checks }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| builds: | ||
| - src/** | ||
| - include/** | ||
| - benchmarks/** | ||
| - cpp-example-collection | ||
| - cpp-example-collection/** | ||
| - client-sdk-rust/** | ||
| - cmake/** | ||
| - docker/** | ||
| - CMakeLists.txt | ||
| - CMakePresets.json | ||
| - build* | ||
| - .build* | ||
| - vcpkg.json | ||
| - .github/workflows/ci.yml | ||
| - .github/workflows/builds.yml | ||
| tests: | ||
| - src/** | ||
| - include/** | ||
| - client-sdk-rust/** | ||
| - cmake/** | ||
| - .token_helpers/** | ||
| - CMakeLists.txt | ||
| - CMakePresets.json | ||
| - build* | ||
| - .build* | ||
| - vcpkg.json | ||
| - .github/workflows/ci.yml | ||
| - .github/workflows/tests.yml | ||
| docs: | ||
| - README.md | ||
| - include/** | ||
| - docs/** | ||
| - scripts/generate-docs.sh | ||
| - .github/workflows/ci.yml | ||
| - .github/workflows/generate-docs.yml | ||
| - .github/workflows/publish-docs.yml | ||
| - "!AGENTS.md" | ||
| cpp_checks: | ||
| - src/** | ||
| - include/** | ||
| - benchmarks/** | ||
| - client-sdk-rust/** | ||
| - cmake/** | ||
| - CMakeLists.txt | ||
| - CMakePresets.json | ||
| - scripts/clang-format.sh | ||
| - scripts/clang-tidy.sh | ||
| - .clang-format | ||
| - .clang-tidy | ||
| - .github/workflows/ci.yml | ||
| - .github/workflows/cpp-checks.yml | ||
|
|
||
| builds: | ||
| name: Builds | ||
| needs: changes | ||
| if: ${{ needs.changes.outputs.builds == 'true' || github.event_name == 'workflow_dispatch' }} | ||
| uses: ./.github/workflows/builds.yml | ||
| secrets: inherit | ||
|
|
||
| tests: | ||
| name: Tests | ||
| needs: changes | ||
| if: ${{ needs.changes.outputs.tests == 'true' || github.event_name == 'workflow_dispatch' }} | ||
| uses: ./.github/workflows/tests.yml | ||
| secrets: inherit | ||
|
|
||
| # license-check is cheap (seconds) and broad enough that it should run on | ||
| # every PR. | ||
| license-check: | ||
| name: License Check | ||
| uses: ./.github/workflows/license_check.yml | ||
|
|
||
| cpp-checks: | ||
| name: C++ Checks | ||
| needs: changes | ||
| if: ${{ needs.changes.outputs.cpp_checks == 'true' || github.event_name == 'workflow_dispatch' }} | ||
| uses: ./.github/workflows/cpp-checks.yml | ||
|
|
||
| generate-docs: | ||
| name: Generate Docs | ||
| needs: changes | ||
| if: ${{ needs.changes.outputs.docs == 'true' || github.event_name == 'workflow_dispatch' }} | ||
| uses: ./.github/workflows/generate-docs.yml | ||
|
|
||
| # Context: GitHub repository rulesets "required checks" actually need a job name to list. | ||
| # This job is an aggregate job | ||
| ci: | ||
| name: CI | ||
| runs-on: ubuntu-latest | ||
| # List all the jobs that need to succeed for the CI to pass | ||
| needs: | ||
| - changes | ||
| - builds | ||
| - tests | ||
| - license-check | ||
| - cpp-checks | ||
| - generate-docs | ||
| if: always() | ||
| steps: | ||
| - name: Verify required CI jobs | ||
| uses: suzuki-shunsuke/required-status-check-action@2b5a46064846b09381852c2c4217e898f639e768 # v0.1.3 | ||
| with: | ||
| needs: ${{ toJson(needs) }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| name: C++ Checks | ||
|
|
||
| # Called by top-level ci.yml | ||
| on: | ||
| workflow_call: {} | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| clang-format: | ||
| name: clang-format | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: false | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| # No submodules: scripts/clang-format.sh only walks our own src/ tree | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Install clang-format 22 | ||
| run: | | ||
| set -eux | ||
| # Pin clang-format 22 to match the current macOS Homebrew LLVM | ||
| # Ubuntu 24.04's default clang-format ships with LLVM 18 | ||
| sudo install -m 0755 -d /etc/apt/keyrings | ||
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \ | ||
| | sudo tee /etc/apt/keyrings/llvm.asc >/dev/null | ||
| sudo chmod a+r /etc/apt/keyrings/llvm.asc | ||
| codename=$(lsb_release -cs) | ||
| echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-22 main" \ | ||
| | sudo tee /etc/apt/sources.list.d/llvm-22.list >/dev/null | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang-format-22 | ||
| sudo ln -sf /usr/bin/clang-format-22 /usr/local/bin/clang-format | ||
| clang-format --version | ||
|
|
||
| - name: Run clang-format | ||
| env: | ||
| FORMAT_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| run: ./scripts/clang-format.sh | ||
|
|
||
| clang-tidy: | ||
| name: clang-tidy | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: false | ||
|
|
||
| steps: | ||
| - name: Checkout (with submodules) | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| submodules: recursive | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| set -eux | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| build-essential cmake ninja-build pkg-config \ | ||
| llvm-dev libclang-dev clang \ | ||
| libssl-dev wget ca-certificates gnupg | ||
|
|
||
| - name: Install clang-tidy 19 (for ExcludeHeaderFilterRegex support) | ||
| run: | | ||
| set -eux | ||
| # Ubuntu 24.04 apt ships clang-tidy 18, which doesn't understand | ||
| # ExcludeHeaderFilterRegex (added in 19). Pull clang-tidy 19 from | ||
| # the upstream LLVM apt repository and pin the unversioned names. | ||
| sudo install -m 0755 -d /etc/apt/keyrings | ||
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \ | ||
| | sudo tee /etc/apt/keyrings/llvm.asc >/dev/null | ||
| sudo chmod a+r /etc/apt/keyrings/llvm.asc | ||
| codename=$(lsb_release -cs) | ||
| echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" \ | ||
| | sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang-tidy-19 clang-tools-19 | ||
| sudo ln -sf /usr/bin/clang-tidy-19 /usr/local/bin/clang-tidy | ||
| sudo ln -sf /usr/bin/run-clang-tidy-19 /usr/local/bin/run-clang-tidy | ||
| clang-tidy --version | ||
| run-clang-tidy --help | head -1 || true | ||
|
|
||
| - name: Install Rust (stable) | ||
| uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Set Linux build environment | ||
| run: | | ||
| echo "CXXFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV" | ||
| echo "CFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV" | ||
| LLVM_VERSION=$(llvm-config --version | cut -d. -f1) | ||
| echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV" | ||
|
|
||
| - name: CMake configure | ||
| run: cmake --preset linux-release | ||
|
|
||
| - name: Generate protobuf headers | ||
| run: cmake --build build-release --target livekit_proto | ||
|
|
||
| - name: Run clang-tidy | ||
| env: | ||
| TIDY_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| # This script is intended to be run locally and in CI. It will auto-detect | ||
| # the GHA environment and add PR annotations and a run summary. | ||
| # As of writing all warnings are treateded as errors to avoid tech debt build up | ||
| run: ./scripts/clang-tidy.sh --fail-on-warning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.