Try cpp-tools #325
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
| 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_tools: ${{ steps.filter.outputs.cpp_tools }} | |
| rust_release_check: ${{ steps.filter.outputs.rust_release_check }} | |
| docker: ${{ steps.filter.outputs.docker }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - 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 | |
| - client-sdk-rust/** | |
| - cmake/** | |
| - CMakeLists.txt | |
| - CMakePresets.json | |
| - build* | |
| - .build* | |
| - vcpkg.json | |
| - .github/workflows/ci.yml | |
| - .github/workflows/builds.yml | |
| tests: | |
| - src/** | |
| - include/** | |
| - client-sdk-rust | |
| - 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 | |
| cpp_tools: | |
| - src/** | |
| - include/** | |
| - benchmarks/** | |
| - client-sdk-rust | |
| - client-sdk-rust/** | |
| - cmake/** | |
| - CMakeLists.txt | |
| - CMakePresets.json | |
| - cpp-tools | |
| - cpp-tools/** | |
| - .gitmodules | |
| - .github/workflows/ci.yml | |
| docker: | |
| - docker/** | |
| - .github/workflows/ci.yml | |
| - .github/workflows/docker-images.yml | |
| rust_release_check: | |
| - client-sdk-rust | |
| builds: | |
| name: Builds | |
| needs: changes | |
| if: ${{ needs.changes.outputs.builds == 'true' || github.event_name == 'workflow_dispatch' }} | |
| uses: ./.github/workflows/builds.yml | |
| secrets: inherit | |
| docker-images: | |
| name: Docker Images | |
| needs: changes | |
| if: ${{ (github.event_name == 'pull_request' && needs.changes.outputs.docker == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.docker == 'true') || github.event_name == 'workflow_dispatch' }} | |
| permissions: | |
| contents: read | |
| actions: read | |
| packages: write | |
| uses: ./.github/workflows/docker-images.yml | |
| with: | |
| push_images: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| 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 | |
| # link-check is cheap (seconds) and should run on every PR | |
| link-check: | |
| name: Link Check | |
| uses: ./.github/workflows/link_check.yml | |
| cpp-tools: | |
| name: C++ Tools | |
| needs: changes | |
| if: ${{ needs.changes.outputs.cpp_tools == 'true' || github.event_name == 'workflow_dispatch' }} | |
| # GitHub loads this workflow from the separate cpp-tools repository. Keep | |
| # this immutable ref aligned with the cpp-tools submodule gitlink. | |
| uses: livekit/cpp-tools/.github/workflows/cpp-tools.yml@f2dbc227187f9434f6bba9e95e0a2da4638b973b | |
| with: | |
| clang_format: true | |
| clang_tidy: true | |
| checkout_submodules: recursive | |
| clang_format_paths: src include benchmarks | |
| clang_tidy_dependencies_command: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential cmake ninja-build pkg-config \ | |
| llvm-dev libclang-dev clang \ | |
| libssl-dev libcurl4-openssl-dev wget ca-certificates gnupg | |
| clang_tidy_install_rust: true | |
| clang_tidy_setup_command: | | |
| 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" | |
| clang_tidy_configure_command: cmake --preset linux-release | |
| clang_tidy_generate_command: cmake --build build-release --target livekit_proto | |
| clang_tidy_build_dir: build-release | |
| clang_tidy_file_regex: '^(?!.*/(_deps|build-[^/]*|client-sdk-rust|cpp-example-collection|vcpkg_installed|docker|docs|data)/).*/src/(?!tests/).*\.(c|cpp|cc|cxx)$' | |
| clang_tidy_header_filter: '.*/(include/livekit|src)/.*\.(h|hpp)$' | |
| clang_tidy_exclude_header_filter: '(.*/src/tests/.*)|(.*/_deps/.*)|(.*/build-[^/]*/.*)' | |
| clang_tidy_require_generated_protobuf: build-release/generated | |
| generate-docs: | |
| name: Generate Docs | |
| needs: changes | |
| if: ${{ needs.changes.outputs.docs == 'true' || github.event_name == 'workflow_dispatch' }} | |
| uses: ./.github/workflows/generate-docs.yml | |
| # Only runs on a client-sdk-rust submodule bump. Runs in parallel and is not a | |
| # dependency of builds/tests, so developer iteration against an unreleased | |
| # Rust commit still gets full build feedback in CI. | |
| rust-release-check: | |
| name: Rust Release Check | |
| needs: changes | |
| if: ${{ needs.changes.outputs.rust_release_check == 'true' || github.event_name == 'workflow_dispatch' }} | |
| uses: ./.github/workflows/rust-release-check.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 | |
| - docker-images | |
| - tests | |
| - license-check | |
| - cpp-tools | |
| - generate-docs | |
| - link-check | |
| - rust-release-check | |
| if: always() | |
| steps: | |
| - name: Verify required CI jobs | |
| uses: suzuki-shunsuke/required-status-check-action@2b5a46064846b09381852c2c4217e898f639e768 # v0.1.3 | |
| with: | |
| needs: ${{ toJson(needs) }} |