Skip to content

Commit

Permalink
CI: add clang-tidy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Dec 9, 2024
1 parent b8e3808 commit 57b5221
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 23 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ jobs:
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file ${{github.workspace}}/Note.md
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json
- name: clean test tag
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
continue-on-error: true
run: |
gh release delete test_${{ github.ref_name }} -y --cleanup-tag
- name: Upload test tag To Github Release
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: |
gh release create test_${{ github.ref_name }} --prerelease --latest=false --title "Recently developed build - ${{ github.ref_name }}" --notes-file ${{github.workspace}}/Note.md
gh release upload test_${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json --clobber
# - name: clean test tag
# if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
# continue-on-error: true
# run: |
# gh release delete test_${{ github.ref_name }} -y --cleanup-tag

# - name: Upload test tag To Github Release
# if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
# run: |
# gh release create test_${{ github.ref_name }} --prerelease --latest=false --title "Recently developed build - ${{ github.ref_name }}" --notes-file ${{github.workspace}}/Note.md
# gh release upload test_${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md ${{github.workspace}}/update.json --clobber
24 changes: 24 additions & 0 deletions .github/workflows/clang-tidy-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Post clang-tidy review comments

on:
workflow_run:
workflows: ["clang-tidy-review"]
types:
- completed

permissions:
pull-requests: write
issues: write
checks: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: ZedThree/clang-tidy-review/[email protected]
# lgtm_comment_body, max_comments, and annotations need to be set on the posting workflow in a split setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
annotations: false
max_comments: 10
171 changes: 171 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: clang-tidy-review

on:
pull_request:
branches: [ master ]

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
build_ubuntu:
strategy:
matrix:
BUILD_TYPE: [Release]

# See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
# See: https://github.com/actions/runner-images/
runs-on: ubuntu-latest

env:
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
SOURCE_DIR: ${{github.workspace}}/.cache/source
TOOSL_DIR: ${{github.workspace}}/.cache/tools
INSTALL_DIR: ${{github.workspace}}/.cache/install

steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true

- name: Make directories
run: |
cmake -E make_directory ${{github.workspace}}/build
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOSL_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: Cache installed
uses: actions/cache@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: install_ubuntu_${{matrix.BUILD_TYPE}}

- name: build FreeRDP
if: false
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/FreeRDP3 ]; then
git clone -b 3.8.0 --depth=1 https://github.com/FreeRDP/FreeRDP.git
# git clone https://github.com/KangLin/FreeRDP.git
cd FreeRDP
git submodule update --init --recursive
cmake -E make_directory build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX="${{env.INSTALL_DIR}}" \
-DWITH_SERVER=ON \
-DWITH_CLIENT_SDL=OFF \
-DWITH_KRB5=OFF \
-DWITH_MANPAGES=OFF
cmake --build . --parallel $(nproc) --config ${{matrix.BUILD_TYPE}}
cmake --build . --config ${{matrix.BUILD_TYPE}} --target install
fi
- name: build RabbitVNC
if: false
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/RabbitVNC ]; then
git clone --depth=1 https://github.com/KangLin/RabbitVNC.git
cd ${{env.SOURCE_DIR}}/RabbitVNC
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DBUILD_TESTS=OFF -DBUILD_VIEWER=OFF
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build tigervnc
#if: ${{ matrix.BUILD_TYPE == 'Debug'}}
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/tigervnc ]; then
git clone --depth=1 https://github.com/KangLin/tigervnc.git
cd ${{env.SOURCE_DIR}}/tigervnc
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DBUILD_TESTS=OFF -DBUILD_VIEWER=OFF
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build libdatachannel
working-directory: ${{env.SOURCE_DIR}}
if: false
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/LibDataChannel ]; then
git clone -b v0.22.2 --depth=1 https://github.com/paullouisageneau/libdatachannel.git
cd libdatachannel
git submodule update --init --recursive
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: build QtService
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/QtService ]; then
git clone --depth=1 https://github.com/KangLin/qt-solutions.git
cd qt-solutions/qtservice
git submodule update --init --recursive
cmake -E make_directory build
cd build
export Qt6_DIR=/usr/lib/`uname -a`-linux-gnu/cmake/Qt6
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }}
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
- name: pcapplusplus
working-directory: ${{env.SOURCE_DIR}}
run: |
if [ ! -d ${{env.INSTALL_DIR}}/lib/cmake/pcapplusplus ]; then
git clone -b v24.09 --depth=1 https://github.com/seladb/PcapPlusPlus.git
cd PcapPlusPlus
cmake -E make_directory build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
-DPCAPPP_BUILD_EXAMPLES=OFF \
-DPCAPPP_BUILD_TESTS=OFF \
-DPCAPPP_BUILD_TUTORIALS=OFF
cmake --build . --parallel $(nproc) --config ${{ matrix.BUILD_TYPE }}
cmake --build . --config ${{ matrix.BUILD_TYPE }} --target install
fi
# Run clang-tidy
- uses: ZedThree/[email protected]
env:
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
id: review
with:
split_workflow: true
clang_tidy_checks: ''
lgtm_comment_body: 'clang-tidy review says "All clean, LGTM! 👍"'
# List of packages to install
apt_packages: cmake qt6-tools-dev qt6-tools-dev-tools qt6-base-dev qt6-base-dev-tools qt6-qpa-plugins libqt6svg6-dev qt6-l10n-tools qt6-translations-l10n qt6-scxml-dev qt6-multimedia-dev libqt6serialport6-dev libxkbcommon-dev libxkbcommon-x11-dev xorg-dev libx11-xcb-dev libx11-dev libxfixes-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-cursor0 libxcb-xinerama0-dev libxcb-composite0-dev libxcomposite-dev libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev libpixman-1-dev libpam0g-dev libutf8proc-dev libfuse3-dev libusb-1.0-0-dev libvncserver-dev libssh-dev libtelnet-dev freerdp2-dev libpcap-dev libcups2-dev libavcodec-dev libavformat-dev libresample1-dev libswscale-dev libcmark-dev
# CMake command to run in order to generate compile_commands.json
build_dir: tidy
cmake_command: cmake -Btidy -S. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_FIND_ROOT_PATH=${{env.INSTALL_DIR}} -DRabbitCommon_ROOT=${{env.SOURCE_DIR}}/RabbitCommon -DCMARK_SHARED=OFF -DCMARK_TESTS=OFF -DCMARK_STATIC=ON -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}}

# Uploads an artefact containing clang_fixes.json
- uses: ZedThree/clang-tidy-review/[email protected]
id: upload-review
1 change: 1 addition & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ jobs:
-T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
-DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" ^
-DCMAKE_FIND_ROOT_PATH=${{env.INSTALL_DIR}} ^
-DBUILD_TESTS=OFF -DBUILD_VIEWER=OFF ^
-DCMAKE_TOOLCHAIN_FILE="${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" ^
-DVCPKG_VERBOSE=ON ^
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ jobs:
libfuse3-dev libusb-1.0-0-dev \
libvncserver-dev libssh-dev libtelnet-dev freerdp2-dev \
libpcap-dev libcups2-dev \
libavcodec-dev libavformat-dev libresample1-dev libswscale-dev
libavcodec-dev libavformat-dev libresample1-dev libswscale-dev \
libcmark-dev
- name: Cache installed
uses: actions/cache@v3
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ It include remote desktop, remote terminal, player etc remote control functions.
- [x] Unix/Linux
- [x] [Android](https://doc.qt.io/qt-6/android.html)
- [x] mac os
- [ ] IPHONE
- [ ] WINCE

See: [Qt5](https://doc.qt.io/qt-5/supported-platforms.html), [Qt6](https://doc.qt.io/qt-6/supported-platforms.html)
See: [Qt5](https://doc.qt.io/qt-5/supported-platforms.html),
[Qt6](https://doc.qt.io/qt-6/supported-platforms.html)

I have no devices so I did not compile and test. Please test by yourself if you have devices.
I have no the mac devices so I did not compile and test. Please test by yourself if you have devices.
Interested and capable friends are welcome to participate in the development of the project.

If you want to donate the developed devices for me, please contact: (email: [email protected])
Expand Down Expand Up @@ -239,6 +238,10 @@ If it cannot be displayed, please open:
- https://gitlab.com/kl222/RabbitCommon/-/raw/master/Src/Resource/image/Contribute.png
- https://sourceforge.net/p/rabbitcommon/code/ci/master/tree/Src/Resource/image/Contribute.png

Contact me:
- <[email protected]>
- [jami](https://jami.net): eddacfd6c7b70b258e511e812ffab7d3490396fa

## Contribution

- [Mailing list](https://sourceforge.net/p/rabbitremotecontrol/mailman/)
Expand All @@ -247,7 +250,8 @@ If it cannot be displayed, please open:
- [Issues](https://github.com/KangLin/RabbitRemoteControl/issues)
- [![Join the chat at https://gitter.im/RabbitRemoteControl/community](https://badges.gitter.im/RabbitRemoteControl/community.svg)](https://gitter.im/RabbitRemoteControl/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
- [Discussions](https://github.com/KangLin/RabbitRemoteControl/discussions)
- [Contributors](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors): Thank [Contributors](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors)
- [Contributors](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors):
Thank [Contributors](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors)

If you're wondering how could you help, fear not, there are plenty of ways:

Expand Down
14 changes: 9 additions & 5 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@
- [x] Unix/Linux
- [x] [Android](https://doc.qt.io/qt-6/android.html)
- [x] mac os
- [ ] IPHONE
- [ ] WINCE

详见:[Qt5 支持平台](https://doc.qt.io/qt-5/supported-platforms.html)[Qt6 支持平台](https://doc.qt.io/qt-6/supported-platforms.html)
详见:[Qt5 支持平台](https://doc.qt.io/qt-5/supported-platforms.html)
[Qt6 支持平台](https://doc.qt.io/qt-6/supported-platforms.html)

未选中的操作系统是因为本人没有设备,所以没有做编译与测试。请有设备的朋友自行测试。
因为本人没有 mac 设备,所以没有做编译与测试。请有设备的朋友自行测试。
欢迎有兴趣,有能力的朋友参与项目的开发。

如果你想为本人捐赠开发设备,请联系:[email protected]
Expand Down Expand Up @@ -238,6 +237,10 @@
- https://gitlab.com/kl222/RabbitCommon/-/raw/master/Src/Resource/image/Contribute.png
- https://sourceforge.net/p/rabbitcommon/code/ci/master/tree/Src/Resource/image/Contribute.png

联系:
- <[email protected]>
- [jami](https://jami.net): eddacfd6c7b70b258e511e812ffab7d3490396fa

## 贡献

- [邮件列表](https://sourceforge.net/p/rabbitremotecontrol/mailman/)
Expand All @@ -246,7 +249,8 @@
- [问题](https://github.com/KangLin/RabbitRemoteControl/issues)
- [![加入聊天 https://gitter.im/RabbitRemoteControl/community](https://badges.gitter.im/RabbitRemoteControl/community.svg)](https://gitter.im/RabbitRemoteControl/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
- [讨论](https://github.com/KangLin/RabbitRemoteControl/discussions)
- [贡献者](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors): 感谢[贡献者](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors)
- [贡献者](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors):
感谢[贡献者](https://github.com/KangLin/RabbitRemoteControl/graphs/contributors)

如果您想知道如何提供帮助,不要害怕,有很多方法:

Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Section: main
Priority: optional
Maintainer: Kang Lin <[email protected]>
Build-Depends: debhelper(>= 13), debhelper-compat (=13), fakeroot, cmake(>=3.21),
libssl-dev, libcmark-dev, rabbitcommon-dev(>=2.2.6),
libssl-dev, libcmark-dev, rabbitcommon-dev(>=2.3.1),
qt6-tools-dev, qt6-tools-dev-tools,
qt6-base-dev, qt6-base-dev-tools, qt6-qpa-plugins, qt6-l10n-tools,
qt6-translations-l10n, qt6-scxml-dev, qt6-multimedia-dev,
Expand Down
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ CHANGLOG_TMP=${SOURCE_DIR}/debian/changelog.tmp
CHANGLOG_FILE=${SOURCE_DIR}/debian/changelog
echo "rabbitremotecontrol (${DEBIAN_VERSION}) unstable; urgency=medium" > ${CHANGLOG_FILE}
echo "" >> ${CHANGLOG_FILE}
echo " * Full Changelog: [${PRE_TAG}..${VERSION}](https://github.com/KangLin/RabbitRemoteControl/compare/${PRE_TAG}..${VERSION})" >> ${CHANGLOG_FILE}
#echo "`git log --pretty=format:' * %s' ${PRE_TAG}..HEAD`" >> ${CHANGLOG_FILE}
echo "" >> ${CHANGLOG_FILE}
echo " -- `git log --pretty=format:'%an <%ae>' HEAD^..HEAD` `date --rfc-email`" >> ${CHANGLOG_FILE}
Expand Down

0 comments on commit 57b5221

Please sign in to comment.