2022-09-30 22:52:54 +03:00
name : clang-tidy-review
2023-09-25 12:19:22 +03:00
on :
pull_request :
types : [ opened, synchronize, reopened]
2022-09-30 22:52:54 +03:00
jobs :
clang-tidy :
2024-07-21 09:46:03 +03:00
runs-on : ubuntu-latest
container : ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.6.3-2
2022-09-30 22:52:54 +03:00
steps :
2023-10-25 12:25:03 +03:00
- uses : actions/checkout@v4
2022-09-30 22:52:54 +03:00
with :
fetch-depth : 2
- name : Prepare compile_commands.json
run : |
2024-07-21 09:46:03 +03:00
cmake -G Ninja -B build -DCMAKE_PREFIX_PATH=/opt/qt6.6.3 -DQT_MAJOR_VERSION=6 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DOPENSSL_ROOT_DIR=/usr/local/lib64
2022-09-30 22:52:54 +03:00
cd build && ninja
2022-09-30 22:52:54 +03:00
- name : Create results directory
run : |
mkdir clang-tidy-result
- name : Analyze
run : |
2024-07-21 09:46:03 +03:00
/usr/bin/git config --global --add safe.directory "$GITHUB_WORKSPACE"
/usr/bin/git diff -U0 HEAD^ | clang-tidy-diff-15.py -checks='-*,modernize-use-auto,modernize-use-using,modernize-use-nodiscard,modernize-use-nullptr,modernize-use-override,cppcoreguidelines-pro-type-static-cast-downcast' -p1 -path build -export-fixes clang-tidy-result/fixes.yml
2022-09-30 22:52:54 +03:00
- name : Run clang-tidy-pr-comments action
2024-10-29 02:12:24 +03:00
uses: platisd/clang-tidy-pr-comments@v1.5.1 # >1.4.3 switches to composite method w/ a forced python version and breaks things : https://github.com/actions/setup-python/issues/871
2022-09-30 22:52:54 +03:00
with :
# The GitHub token (or a personal access token)
github_token : ${{ secrets.GITHUB_TOKEN }}
# The path to the clang-tidy fixes generated previously
clang_tidy_fixes : clang-tidy-result/fixes.yml
# Optionally set to true if you want the Action to request
# changes in case warnings are found
request_changes : true
# Optionally set the number of comments per review
# to avoid GitHub API timeouts for heavily loaded
# pull requests
suggestions_per_comment : 10