Skip to content

Commit 77146ca

Browse files
Move quality checks out of builds
1 parent e70feaf commit 77146ca

3 files changed

Lines changed: 133 additions & 110 deletions

File tree

.github/workflows/builds.yml

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ jobs:
539539
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
540540
cmake --build build --parallel
541541
'
542-
543542
build-collections-x64:
544543
name: Build (cpp-example-collection-x64)
545544
runs-on: ubuntu-latest
@@ -586,108 +585,3 @@ jobs:
586585
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk
587586
cmake --build build --parallel
588587
'
589-
590-
clang-format:
591-
name: clang-format
592-
runs-on: ubuntu-latest
593-
continue-on-error: false
594-
permissions:
595-
contents: read
596-
597-
steps:
598-
- name: Checkout
599-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
600-
with:
601-
# No submodules: scripts/clang-format.sh only walks our own src/ tree
602-
fetch-depth: 1
603-
604-
- name: Install clang-format 22
605-
run: |
606-
set -eux
607-
# Pin clang-format 22 to match the current macOS Homebrew LLVM
608-
# Ubuntu 24.04's default clang-format ships with LLVM 18
609-
sudo install -m 0755 -d /etc/apt/keyrings
610-
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
611-
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
612-
sudo chmod a+r /etc/apt/keyrings/llvm.asc
613-
codename=$(lsb_release -cs)
614-
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-22 main" \
615-
| sudo tee /etc/apt/sources.list.d/llvm-22.list >/dev/null
616-
sudo apt-get update
617-
sudo apt-get install -y clang-format-22
618-
sudo ln -sf /usr/bin/clang-format-22 /usr/local/bin/clang-format
619-
clang-format --version
620-
621-
- name: Run clang-format
622-
env:
623-
FORMAT_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
624-
run: ./scripts/clang-format.sh
625-
626-
clang-tidy:
627-
name: clang-tidy
628-
runs-on: ubuntu-latest
629-
continue-on-error: false
630-
permissions:
631-
contents: read
632-
633-
steps:
634-
- name: Checkout (with submodules)
635-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
636-
with:
637-
submodules: recursive
638-
fetch-depth: 1
639-
640-
- name: Install dependencies
641-
run: |
642-
set -eux
643-
sudo apt-get update
644-
sudo apt-get install -y \
645-
build-essential cmake ninja-build pkg-config \
646-
llvm-dev libclang-dev clang \
647-
libssl-dev wget ca-certificates gnupg
648-
649-
- name: Install clang-tidy 19 (for ExcludeHeaderFilterRegex support)
650-
run: |
651-
set -eux
652-
# Ubuntu 24.04 apt ships clang-tidy 18, which doesn't understand
653-
# ExcludeHeaderFilterRegex (added in 19). Pull clang-tidy 19 from
654-
# the upstream LLVM apt repository and pin the unversioned names.
655-
sudo install -m 0755 -d /etc/apt/keyrings
656-
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
657-
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
658-
sudo chmod a+r /etc/apt/keyrings/llvm.asc
659-
codename=$(lsb_release -cs)
660-
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" \
661-
| sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null
662-
sudo apt-get update
663-
sudo apt-get install -y clang-tidy-19 clang-tools-19
664-
sudo ln -sf /usr/bin/clang-tidy-19 /usr/local/bin/clang-tidy
665-
sudo ln -sf /usr/bin/run-clang-tidy-19 /usr/local/bin/run-clang-tidy
666-
clang-tidy --version
667-
run-clang-tidy --help | head -1 || true
668-
669-
- name: Install Rust (stable)
670-
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
671-
with:
672-
toolchain: stable
673-
674-
- name: Set Linux build environment
675-
run: |
676-
echo "CXXFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
677-
echo "CFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
678-
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
679-
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
680-
681-
- name: CMake configure
682-
run: cmake --preset linux-release
683-
684-
- name: Generate protobuf headers
685-
run: cmake --build build-release --target livekit_proto
686-
687-
- name: Run clang-tidy
688-
env:
689-
TIDY_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
690-
# This script is intended to be run locally and in CI. It will auto-detect
691-
# the GHA environment and add PR annotations and a run summary.
692-
# As of writing all warnings are treateded as errors to avoid tech debt build up
693-
run: ./scripts/clang-tidy.sh --fail-on-warning

.github/workflows/ci.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
builds: ${{ steps.filter.outputs.builds }}
3030
tests: ${{ steps.filter.outputs.tests }}
3131
docs: ${{ steps.filter.outputs.docs }}
32+
quality: ${{ steps.filter.outputs.quality }}
3233
steps:
3334
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3435
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
@@ -44,17 +45,13 @@ jobs:
4445
- client-sdk-rust/**
4546
- cmake/**
4647
- docker/**
47-
- scripts/clang-format.sh
48-
- scripts/clang-tidy.sh
4948
- CMakeLists.txt
5049
- CMakePresets.json
5150
- build.sh
5251
- build.cmd
5352
- build.h.in
5453
- .build-info.json.in
5554
- vcpkg.json
56-
- .clang-format
57-
- .clang-tidy
5855
- .github/workflows/ci.yml
5956
- .github/workflows/builds.yml
6057
tests:
@@ -80,6 +77,20 @@ jobs:
8077
- .github/workflows/ci.yml
8178
- .github/workflows/generate-docs.yml
8279
- .github/workflows/publish-docs.yml
80+
quality:
81+
- src/**
82+
- include/**
83+
- benchmarks/**
84+
- client-sdk-rust/**
85+
- cmake/**
86+
- CMakeLists.txt
87+
- CMakePresets.json
88+
- scripts/clang-format.sh
89+
- scripts/clang-tidy.sh
90+
- .clang-format
91+
- .clang-tidy
92+
- .github/workflows/ci.yml
93+
- .github/workflows/quality-checks.yml
8394
8495
builds:
8596
name: Builds
@@ -105,6 +116,12 @@ jobs:
105116
name: Pin Check
106117
uses: ./.github/workflows/pin_check.yml
107118

119+
quality-checks:
120+
name: Quality Checks
121+
needs: changes
122+
if: ${{ needs.changes.outputs.quality == 'true' || github.event_name != 'pull_request' }}
123+
uses: ./.github/workflows/quality-checks.yml
124+
108125
generate-docs:
109126
name: Generate Docs
110127
needs: changes
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Quality Checks
2+
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.
5+
on:
6+
workflow_call: {}
7+
workflow_dispatch: {}
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
clang-format:
14+
name: clang-format
15+
runs-on: ubuntu-latest
16+
continue-on-error: false
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
# No submodules: scripts/clang-format.sh only walks our own src/ tree
23+
fetch-depth: 1
24+
25+
- name: Install clang-format 22
26+
run: |
27+
set -eux
28+
# Pin clang-format 22 to match the current macOS Homebrew LLVM
29+
# Ubuntu 24.04's default clang-format ships with LLVM 18
30+
sudo install -m 0755 -d /etc/apt/keyrings
31+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
32+
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
33+
sudo chmod a+r /etc/apt/keyrings/llvm.asc
34+
codename=$(lsb_release -cs)
35+
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-22 main" \
36+
| sudo tee /etc/apt/sources.list.d/llvm-22.list >/dev/null
37+
sudo apt-get update
38+
sudo apt-get install -y clang-format-22
39+
sudo ln -sf /usr/bin/clang-format-22 /usr/local/bin/clang-format
40+
clang-format --version
41+
42+
- name: Run clang-format
43+
env:
44+
FORMAT_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
45+
run: ./scripts/clang-format.sh
46+
47+
clang-tidy:
48+
name: clang-tidy
49+
runs-on: ubuntu-latest
50+
continue-on-error: false
51+
52+
steps:
53+
- name: Checkout (with submodules)
54+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+
with:
56+
submodules: recursive
57+
fetch-depth: 1
58+
59+
- name: Install dependencies
60+
run: |
61+
set -eux
62+
sudo apt-get update
63+
sudo apt-get install -y \
64+
build-essential cmake ninja-build pkg-config \
65+
llvm-dev libclang-dev clang \
66+
libssl-dev wget ca-certificates gnupg
67+
68+
- name: Install clang-tidy 19 (for ExcludeHeaderFilterRegex support)
69+
run: |
70+
set -eux
71+
# Ubuntu 24.04 apt ships clang-tidy 18, which doesn't understand
72+
# ExcludeHeaderFilterRegex (added in 19). Pull clang-tidy 19 from
73+
# the upstream LLVM apt repository and pin the unversioned names.
74+
sudo install -m 0755 -d /etc/apt/keyrings
75+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
76+
| sudo tee /etc/apt/keyrings/llvm.asc >/dev/null
77+
sudo chmod a+r /etc/apt/keyrings/llvm.asc
78+
codename=$(lsb_release -cs)
79+
echo "deb [signed-by=/etc/apt/keyrings/llvm.asc] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" \
80+
| sudo tee /etc/apt/sources.list.d/llvm-19.list >/dev/null
81+
sudo apt-get update
82+
sudo apt-get install -y clang-tidy-19 clang-tools-19
83+
sudo ln -sf /usr/bin/clang-tidy-19 /usr/local/bin/clang-tidy
84+
sudo ln -sf /usr/bin/run-clang-tidy-19 /usr/local/bin/run-clang-tidy
85+
clang-tidy --version
86+
run-clang-tidy --help | head -1 || true
87+
88+
- name: Install Rust (stable)
89+
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
90+
with:
91+
toolchain: stable
92+
93+
- name: Set Linux build environment
94+
run: |
95+
echo "CXXFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
96+
echo "CFLAGS=-Wno-deprecated-declarations" >> "$GITHUB_ENV"
97+
LLVM_VERSION=$(llvm-config --version | cut -d. -f1)
98+
echo "LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib" >> "$GITHUB_ENV"
99+
100+
- name: CMake configure
101+
run: cmake --preset linux-release
102+
103+
- name: Generate protobuf headers
104+
run: cmake --build build-release --target livekit_proto
105+
106+
- name: Run clang-tidy
107+
env:
108+
TIDY_BLOB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
109+
# This script is intended to be run locally and in CI. It will auto-detect
110+
# the GHA environment and add PR annotations and a run summary.
111+
# As of writing all warnings are treateded as errors to avoid tech debt build up
112+
run: ./scripts/clang-tidy.sh --fail-on-warning

0 commit comments

Comments
 (0)