Skip to content

Commit 6ae5b83

Browse files
Removed shared workflow
1 parent 75c9e49 commit 6ae5b83

5 files changed

Lines changed: 125 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ jobs:
8787
- cpp-tools/**
8888
- .gitmodules
8989
- .github/workflows/ci.yml
90+
- .github/workflows/cpp-tools.yml
9091
docker:
9192
- docker/**
9293
- .github/workflows/ci.yml
@@ -136,29 +137,7 @@ jobs:
136137
name: C++ Tools
137138
needs: changes
138139
if: ${{ needs.changes.outputs.cpp_tools == 'true' || github.event_name == 'workflow_dispatch' }}
139-
# GitHub loads this workflow from the separate cpp-tools repository. Keep
140-
# this immutable ref aligned with the cpp-tools submodule gitlink.
141-
uses: livekit/cpp-tools/.github/workflows/cpp-tools.yml@707762771f079e0932c8c6a123e943a4b2fefe32
142-
with:
143-
clang_format: true
144-
clang_tidy: true
145-
checkout_submodules: recursive
146-
clang_format_runner: scripts/clang-format.sh
147-
clang_tidy_runner: scripts/clang-tidy.sh
148-
clang_tidy_dependencies_command: |
149-
sudo apt-get update
150-
sudo apt-get install -y \
151-
build-essential cmake ninja-build pkg-config \
152-
llvm-dev libclang-dev clang \
153-
libssl-dev libcurl4-openssl-dev wget ca-certificates gnupg
154-
clang_tidy_install_rust: true
155-
clang_tidy_setup_command: |
156-
echo "CXXFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
157-
echo "CFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
158-
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
159-
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
160-
clang_tidy_configure_command: cmake --preset linux-release
161-
clang_tidy_generate_command: cmake --build build-release --target livekit_proto
140+
uses: ./.github/workflows/cpp-tools.yml
162141

163142
generate-docs:
164143
name: Generate Docs

.github/workflows/cpp-tools.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: C++ Tools
2+
3+
# Called by top-level ci.yml.
4+
on:
5+
workflow_call: {}
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
clang-format:
13+
name: clang-format
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
20+
with:
21+
fetch-depth: 1
22+
23+
- name: Initialize cpp-tools
24+
run: git submodule update --init cpp-tools
25+
26+
- name: Install shared clang-format configuration
27+
run: ./cpp-tools/install.sh clang-format --repo-root "$GITHUB_WORKSPACE" --force
28+
29+
- name: Install clang-format 22
30+
run: |
31+
set -eux
32+
# Pin clang-format 22 to match the current macOS Homebrew LLVM.
33+
# Ubuntu 24.04's default clang-format ships with LLVM 18.
34+
sudo install -m 0755 -d /etc/apt/keyrings
35+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
36+
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
37+
sudo chmod a+r /etc/apt/keyrings/llvm.asc
38+
codename=$(lsb_release -cs)
39+
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-22 main" \
40+
| sudo tee /etc/apt/sources.list.d/llvm-22.list >/dev/null
41+
sudo apt-get update
42+
sudo apt-get install -y clang-format-22
43+
sudo ln -sf /usr/bin/clang-format-22 /usr/local/bin/clang-format
44+
clang-format --version
45+
46+
- name: Run clang-format
47+
env:
48+
FORMAT_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
49+
run: ./scripts/clang-format.sh
50+
51+
clang-tidy:
52+
name: clang-tidy
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 45
55+
56+
steps:
57+
- name: Checkout with submodules
58+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
59+
with:
60+
submodules: recursive
61+
fetch-depth: 1
62+
63+
- name: Install shared clang-tidy configuration
64+
run: ./cpp-tools/install.sh clang-tidy --repo-root "$GITHUB_WORKSPACE" --force
65+
66+
- name: Install dependencies
67+
run: |
68+
set -eux
69+
sudo apt-get update
70+
sudo apt-get install -y \
71+
build-essential cmake ninja-build pkg-config \
72+
llvm-dev libclang-dev clang \
73+
libssl-dev libcurl4-openssl-dev wget ca-certificates gnupg
74+
75+
- name: Install clang-tidy 19
76+
run: |
77+
set -eux
78+
# ExcludeHeaderFilterRegex requires clang-tidy 19 or newer.
79+
sudo install -m 0755 -d /etc/apt/keyrings
80+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
81+
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
82+
sudo chmod a+r /etc/apt/keyrings/llvm.asc
83+
codename=$(lsb_release -cs)
84+
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" \
85+
| sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null
86+
sudo apt-get update
87+
sudo apt-get install -y clang-tidy-19 clang-tools-19
88+
sudo ln -sf /usr/bin/clang-tidy-19 /usr/local/bin/clang-tidy
89+
sudo ln -sf /usr/bin/run-clang-tidy-19 /usr/local/bin/run-clang-tidy
90+
clang-tidy --version
91+
run-clang-tidy --help >/dev/null
92+
93+
- name: Install Rust
94+
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
95+
with:
96+
toolchain: stable
97+
98+
- name: Set Linux build environment
99+
run: |
100+
echo "CXXFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
101+
echo "CFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
102+
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
103+
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
104+
105+
- name: Configure compilation database
106+
run: cmake --preset linux-release
107+
108+
- name: Generate protobuf headers
109+
run: cmake --build build-release --target livekit_proto
110+
111+
- name: Run clang-tidy
112+
env:
113+
TIDY_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
114+
run: ./scripts/clang-tidy.sh --fail-on-warning

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ all filtered stages; normal pull requests and pushes use the path filters.
384384
- `.github/workflows/builds.yml` — Reusable SDK and example-collection build
385385
matrix.
386386
- `.github/workflows/tests.yml` — Reusable unit/integration test matrix.
387-
- `livekit/cpp-tools/.github/workflows/cpp-tools.yml`Shared reusable
388-
workflow called directly by `ci.yml` for `clang-format` and `clang-tidy`
389-
checks.
387+
- `.github/workflows/cpp-tools.yml`Reusable SDK-specific `clang-format` and
388+
`clang-tidy` workflow. It prepares the build environment and invokes the
389+
project wrappers backed by the shared `cpp-tools` scripts.
390390
- `.github/workflows/generate-docs.yml` — Reusable Doxygen docs validation.
391391
- `.github/workflows/rust-release-check.yml` — Reusable check that the pinned
392392
`client-sdk-rust` submodule commit maps to a published release. Gated by the

cpp-tools

docs/tools.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ are also enforced in CI on PRs.
99
[`livekit/cpp-tools`](https://github.com/livekit/cpp-tools) submodule. The
1010
`./cpp-tools/install.sh` script creates root `.clang-tidy` and `.clang-format`
1111
symlinks so editor integrations can discover them automatically.
12-
The workflow visible at `cpp-tools/.github/workflows/cpp-tools.yml` belongs to
13-
the submodule, not the SDK. GitHub loads that workflow from the separate
14-
`livekit/cpp-tools` repository at an immutable commit, then checks out this SDK
15-
and runs the scripts from its submodule. The workflow ref and submodule gitlink
16-
must point to the same commit. Doxygen remains in the SDK-specific
17-
documentation workflow.
12+
The SDK-owned `.github/workflows/cpp-tools.yml` workflow prepares the
13+
project-specific CI environment and calls the same `scripts/clang-format.sh`
14+
and `scripts/clang-tidy.sh` wrappers used locally. The shared scripts detect
15+
GitHub Actions automatically and produce annotations and step summaries.
16+
Doxygen remains in the SDK-specific documentation workflow.
1817

1918
- **`clang-tidy`** — static analysis. See `cpp-tools/.clang-tidy` for the
2019
enabled checks. Enforced in CI on PR.

0 commit comments

Comments
 (0)