-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 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/post@v0.20.1 | ||
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,57 @@ | ||
name: clang-tidy-review | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**.h' | ||
- '**.cc' | ||
|
||
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@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install LLVM and Clang | ||
uses: KyleMayes/install-llvm-action@v2.0.3 | ||
with: | ||
version: "17.0.6" | ||
|
||
- name: install lit | ||
run: pip install lit | ||
|
||
- name: Run clang-tidy | ||
uses: ZedThree/clang-tidy-review@v0.20.1 | ||
id: review | ||
with: | ||
build_dir: build | ||
apt_packages: cmake,libxml2,libxml2-dev,libtinfo-dev,zlib1g-dev,libzstd-dev,wget | ||
split_workflow: true | ||
config_file: .clang-tidy | ||
cmake_command: > | ||
cmake . -B build -DINSTALL_PYTHON=FALSE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON || true && | ||
rm -rf build && | ||
set -x && | ||
wget https://github.com/mamba-org/micromamba-releases/releases/download/1.5.10-0/micromamba-linux-64 && | ||
mv ./micromamba-linux-64 ./micromamba && | ||
chmod a+x ./micromamba && | ||
export PATH="$PWD:$PATH" && | ||
eval "$(micromamba shell hook -s posix)" && | ||
micromamba create -n clang-tidy-review -y --log-level warning -f $GITHUB_WORKSPACE/conda_env.yml && | ||
export PATH=${PATH}:/github/home/micromamba/envs/clang-tidy-review/bin && | ||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/github/home/micromamba/envs/clang-tidy-review/lib && | ||
export PYTHONPATH=${PYTHONPATH}:/github/home/micromamba/envs/clang-tidy-review/lib/python && | ||
micromamba run -n clang-tidy-review cmake . -B build -DINSTALL_PYTHON=FALSE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
- name: Upload artifacts | ||
uses: ZedThree/clang-tidy-review/upload@v0.20.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