mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-24 04:59:21 -04:00
workflow: Add clang-tidy reviews for all pull requests
This commit is contained in:
parent
7b7294b15d
commit
00f68fb8a5
6
.clang-tidy
Normal file
6
.clang-tidy
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,performance-*,portability-*,modernize-use-nullptr'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
FormatStyle: none
|
||||
...
|
34
.github/workflows/lint.yml
vendored
Normal file
34
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
name: Lint
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
clang-tidy:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install clang-tidy
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-tidy build-essential pkg-config libpng-dev libjpeg-dev libtiff-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev libfreetype6-dev libvorbis-dev libeigen3-dev libopenal-dev libode-dev libbullet-dev libgtk-3-dev libassimp-dev libopenexr-dev
|
||||
- name: Prepare compile_commands.json
|
||||
run: |
|
||||
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_UNITY_BUILD=OFF -DHAVE_PYTHON=OFF -DINTERROGATE_PYTHON_INTERFACE=OFF
|
||||
- name: Copy prebuilt files
|
||||
run: |
|
||||
for fn in **/*.prebuilt; do
|
||||
echo mkdir -p $(dirname "cmake/$fn");
|
||||
echo cp "$fn" "cmake/${fn%.*}";
|
||||
done
|
||||
- name: Create results directory
|
||||
run: |
|
||||
mkdir clang-tidy-result
|
||||
- name: Analyze
|
||||
run: |
|
||||
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml
|
||||
- name: Post review
|
||||
uses: platisd/clang-tidy-pr-comments@master
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
clang_tidy_fixes: clang-tidy-result/fixes.yml
|
||||
request_changes: true
|
||||
suggestions_per_comment: 10
|
Loading…
x
Reference in New Issue
Block a user