mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 11:48:56 +03:00
check our code with clang-tidy
should allow to keep our code tidy and maybe simplify reviews Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
3193937e50
commit
88629737c1
1 changed files with 40 additions and 0 deletions
40
.github/workflows/clang-tidy-review.yml
vendored
Normal file
40
.github/workflows/clang-tidy-review.yml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
name: clang-tidy-review
|
||||||
|
|
||||||
|
# You can be more specific, but it currently only works on pull requests
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clang-tidy:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: Install clang-tidy
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y clang-tidy
|
||||||
|
sudo apt-get install -y zlib1g-dev texlive-latex-base qtwebengine5-dev qttools5-dev-tools qttools5-dev qtquickcontrols2-5-dev qt5keychain-dev qtdeclarative5-dev qtbase5-dev python3-sphinx libssl-dev libsqlite3-dev libqt5websockets5-dev libqt5svg5-dev pkg-config libkf5archive-dev libcloudproviders-dev libcmocka-dev libdbus-1-dev qtbase5-private-dev qt5-qmake inkscape
|
||||||
|
- name: Prepare compile_commands.json
|
||||||
|
run: |
|
||||||
|
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1
|
||||||
|
- 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: Run clang-tidy-pr-comments action
|
||||||
|
uses: platisd/clang-tidy-pr-comments@master
|
||||||
|
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
|
Loading…
Reference in a new issue