-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
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] |