Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/clang-tidy-review-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Post clang-tidy review comments

on:
workflow_run:
workflows: ["clang-tidy-review"]
types:
- completed

permissions:
checks: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Post review comments
id: post-review
uses: ZedThree/clang-tidy-review/[email protected]
with:
max_comments: 10

# If there are any comments, fail the check
- if: steps.post-review.outputs.total_comments > 0
run: exit 1
45 changes: 45 additions & 0 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: clang-tidy-review

on:
pull_request:
paths:
- '**.h'
- '**.hpp'
- '**.cpp'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v3

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "12.0.0"

- name: Run clang-tidy
uses: ZedThree/[email protected]
id: review
with:
build_dir: build
apt_packages: libxml2,libxml2-dev,libtinfo-dev,zlib1g-dev,libzstd-dev
exclude: "test/*,unittests/*,benchmark/*,demos/*"
split_workflow: true
cmake_command: >
pip install cmake lit &&
cmake --version &&
git config --global --add safe.directory /github/workspace &&
cmake . -B build -DLLVM_DIR="$GITHUB_WORKSPACE/llvm"
-DClang_DIR="$GITHUB_WORKSPACE/llvm"
-DCMAKE_BUILD_TYPE="Release"
-DLLVM_EXTERNAL_LIT="`which lit`"
-DCMAKE_EXPORT_COMPILE_COMMANDS=On

- name: Upload artifacts
uses: ZedThree/clang-tidy-review/[email protected]