Skip to content

Commit 84d67e7

Browse files
Try cpplinter stage instead
1 parent a3e8900 commit 84d67e7

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

.github/workflows/builds.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ jobs:
246246
${{ matrix.build_dir }}/bin/
247247
retention-days: 7
248248

249-
- name: Debug compile database before upload
250-
if: matrix.name == 'linux-x64'
251-
run: |
252-
echo "=== Files to be uploaded ==="
253-
echo "build_dir=${{ matrix.build_dir }}"
254-
ls -la ${{ matrix.build_dir }}/compile_commands.json || echo "compile_commands.json NOT FOUND"
255-
echo "Generated headers:"
256-
ls -la ${{ matrix.build_dir }}/generated/*.pb.h 2>/dev/null | head -5 || echo "No .pb.h files found"
257-
echo "Generated header count: $(find ${{ matrix.build_dir }}/generated -name '*.pb.h' 2>/dev/null | wc -l)"
258-
259249
- name: Upload compile database (for clang-tidy)
260250
if: matrix.name == 'linux-x64'
261251
uses: actions/upload-artifact@v4
@@ -411,6 +401,9 @@ jobs:
411401
runs-on: ubuntu-latest
412402
continue-on-error: true
413403
if: ${{ !cancelled() }}
404+
permissions:
405+
contents: read
406+
pull-requests: write
414407

415408
steps:
416409
- name: Checkout (with submodules)
@@ -441,18 +434,33 @@ jobs:
441434
with:
442435
name: compile-database
443436
path: build-release/
444-
445-
- name: Collect source files
446-
run: |
447-
find src/ bridge/src/ examples/ \
448-
-name '*.cpp' -not -path '*/tests/*' \
449-
| sort -u > /tmp/tidy-files.txt
450-
echo "Files to analyze ($(wc -l < /tmp/tidy-files.txt)):"
451-
cat /tmp/tidy-files.txt
452437

453438
- name: Run clang-tidy
439+
uses: cpp-linter/cpp-linter-action@v2
440+
id: linter
441+
with:
442+
style: ''
443+
tidy-checks: ''
444+
database: build-release
445+
files-changed-only: true
446+
lines-changed-only: false
447+
ignore: 'build-*|client-sdk-rust|vcpkg_installed'
448+
file-annotations: true
449+
thread-comments: update
450+
step-summary: true
451+
tidy-review: true
452+
passive-reviews: true
453+
no-lgtm: true
454+
version: ''
455+
456+
- name: Check warning thresholds
457+
env:
458+
TIDY_FINDINGS: ${{ steps.linter.outputs.clang-tidy-checks-failed }}
459+
MAX_TIDY_FINDINGS: '0'
454460
run: |
455-
run-clang-tidy \
456-
-p build-release \
457-
-header-filter='(include/livekit|src|bridge/(include|src)|examples)' \
458-
$(cat /tmp/tidy-files.txt)
461+
echo "clang-tidy findings: ${TIDY_FINDINGS}"
462+
if [ "${TIDY_FINDINGS}" -gt "${MAX_TIDY_FINDINGS}" ]; then
463+
echo "::warning::clang-tidy found ${TIDY_FINDINGS} issue(s), threshold is ${MAX_TIDY_FINDINGS}"
464+
exit 1
465+
fi
466+
echo "clang-tidy findings within threshold"

0 commit comments

Comments
 (0)