From c1747bf28990190d02a96ef34ed70fff217ea4ee Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 09:25:11 -0400 Subject: [PATCH 1/8] ci(clang-tidy-review): Fix for qt6 + swap to docker-ci container Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index d8b0b989cbc18..733fc25650389 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -6,19 +6,15 @@ on: jobs: clang-tidy: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.6.3-2 steps: - uses: actions/checkout@v4 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 ninja-build 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 -G Ninja -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 + 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 cd build && ninja - name: Create results directory run: | From a9a32390bbca1ce69f5a8fdc76a5ce2b3bbb1edb Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 09:32:14 -0400 Subject: [PATCH 2/8] fix: add OPENSSL_ROOT_DIR Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 733fc25650389..4f6308c4468e4 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -14,7 +14,7 @@ jobs: fetch-depth: 2 - name: Prepare compile_commands.json run: | - 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 + 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 cd build && ninja - name: Create results directory run: | From ac5a1689a5a3f352c39c752501d5b8f323072646 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 10:01:55 -0400 Subject: [PATCH 3/8] fix: use clang-tidy-diff.py Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 4f6308c4468e4..c26466683b7af 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -21,7 +21,7 @@ jobs: mkdir clang-tidy-result - name: Analyze run: | - git diff -U0 HEAD^ | clang-tidy-diff -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 + git diff -U0 HEAD^ | clang-tidy-diff.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 - name: Run clang-tidy-pr-comments action uses: platisd/clang-tidy-pr-comments@master with: From 6ab4983f33082a31ba99aada09eba9d3b0aafc9e Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 10:19:53 -0400 Subject: [PATCH 4/8] fix: path to clang-tidy-diff.py -> clang-tidy-diff-15.py Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index c26466683b7af..c96735d374285 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -21,7 +21,7 @@ jobs: mkdir clang-tidy-result - name: Analyze run: | - git diff -U0 HEAD^ | clang-tidy-diff.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 + 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 - name: Run clang-tidy-pr-comments action uses: platisd/clang-tidy-pr-comments@master with: From 9bb219ad26de4d518c0fcf08b7702cf4e0ddf19e Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 15:14:15 -0400 Subject: [PATCH 5/8] fix: try to fix git usage Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index c96735d374285..0f4bf11c64c1c 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -21,7 +21,9 @@ jobs: mkdir clang-tidy-result - name: Analyze run: | - 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 + pwd && ls -alt + /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 - name: Run clang-tidy-pr-comments action uses: platisd/clang-tidy-pr-comments@master with: From b45aaf71b9d1207d2cb112f2fc1e24df8da0baf2 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 15:51:40 -0400 Subject: [PATCH 6/8] fix: LD_LIBRARY_PATH workaround for python in clang-tidy-pr-comments Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 0f4bf11c64c1c..b430611ec9fb3 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -26,6 +26,8 @@ jobs: /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 - name: Run clang-tidy-pr-comments action uses: platisd/clang-tidy-pr-comments@master + env: + LD_LIBRARY_PATH: ${{ github.workspace }}/Python/ # workaround for https://github.com/actions/setup-python/issues/871 ever since clang-tidy-pr-comments became composite w/ embedded python version req with: # The GitHub token (or a personal access token) github_token: ${{ secrets.GITHUB_TOKEN }} From 4affce193d7a460f366f0677b69d6d252bb2342f Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 16:30:40 -0400 Subject: [PATCH 7/8] fix: bump back to 1.4.3 clang-tidy-pr-comments to avoid workarounds Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index b430611ec9fb3..a47b5ecbc076f 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -25,9 +25,9 @@ jobs: /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 - name: Run clang-tidy-pr-comments action - uses: platisd/clang-tidy-pr-comments@master - env: - LD_LIBRARY_PATH: ${{ github.workspace }}/Python/ # workaround for https://github.com/actions/setup-python/issues/871 ever since clang-tidy-pr-comments became composite w/ embedded python version req + uses: platisd/clang-tidy-pr-comments@v1.4.3 # >1.4.3 switches to compose and runs into below mentioned issue w/o great workarounds (needs to be fixed by them not us) + #env: + #LD_LIBRARY_PATH: /__w/_tool/Python/ # workaround for https://github.com/actions/setup-python/issues/871 ever since clang-tidy-pr-comments became composite w/ embedded python version req with: # The GitHub token (or a personal access token) github_token: ${{ secrets.GITHUB_TOKEN }} From 5c3c6a81405df2ab2fc14c2273905734f0d1b8cb Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 29 Jun 2024 16:52:04 -0400 Subject: [PATCH 8/8] fix: wrap up after debugging this Signed-off-by: Josh --- .github/workflows/clang-tidy-review.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index a47b5ecbc076f..2094a604d6512 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -21,13 +21,10 @@ jobs: mkdir clang-tidy-result - name: Analyze run: | - pwd && ls -alt /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 - name: Run clang-tidy-pr-comments action - uses: platisd/clang-tidy-pr-comments@v1.4.3 # >1.4.3 switches to compose and runs into below mentioned issue w/o great workarounds (needs to be fixed by them not us) - #env: - #LD_LIBRARY_PATH: /__w/_tool/Python/ # workaround for https://github.com/actions/setup-python/issues/871 ever since clang-tidy-pr-comments became composite w/ embedded python version req + uses: platisd/clang-tidy-pr-comments@v1.4.3 # >1.4.3 switches to composite method w/ a forced python version and breaks things: https://github.com/actions/setup-python/issues/871 with: # The GitHub token (or a personal access token) github_token: ${{ secrets.GITHUB_TOKEN }}