2021-04-18 21:51:47 +02:00
|
|
|
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
|
|
|
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
|
|
|
name: clang-tidy
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-08-26 23:25:07 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-04-18 21:51:47 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2022-05-31 19:55:57 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-04-18 21:51:47 +02:00
|
|
|
|
2022-02-01 17:26:52 +01:00
|
|
|
env:
|
|
|
|
QT_VERSION: 5.15.2
|
|
|
|
|
2021-04-18 21:51:47 +02:00
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-04-18 21:51:47 +02:00
|
|
|
|
|
|
|
- name: Install missing software
|
|
|
|
run: |
|
2022-08-23 21:40:31 +02:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y cmake make
|
|
|
|
sudo apt-get install -y libpcre3-dev
|
|
|
|
sudo apt-get install -y libffi7 # work around missing dependency for Qt install step
|
|
|
|
|
|
|
|
- name: Install clang
|
|
|
|
run: |
|
2023-08-01 14:28:13 +02:00
|
|
|
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
|
2022-08-23 21:40:31 +02:00
|
|
|
wget https://apt.llvm.org/llvm.sh
|
|
|
|
chmod +x llvm.sh
|
2023-02-15 19:46:13 +01:00
|
|
|
sudo ./llvm.sh 16
|
|
|
|
sudo apt-get install -y clang-tidy-16
|
2021-04-24 20:20:09 +02:00
|
|
|
|
2022-02-01 17:26:52 +01:00
|
|
|
- name: Install Qt ${{ env.QT_VERSION }}
|
2023-01-18 17:04:21 +01:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-10-31 20:15:32 +01:00
|
|
|
with:
|
2022-02-01 17:26:52 +01:00
|
|
|
version: ${{ env.QT_VERSION }}
|
2021-10-31 20:15:32 +01:00
|
|
|
modules: 'qtcharts'
|
2023-01-18 17:04:21 +01:00
|
|
|
cache: true
|
2021-04-18 21:51:47 +02:00
|
|
|
|
2022-09-27 20:03:25 +02:00
|
|
|
- name: Verify clang-tidy configuration
|
|
|
|
run: |
|
2023-02-15 19:46:13 +01:00
|
|
|
clang-tidy-16 --verify-config
|
2022-09-27 20:03:25 +02:00
|
|
|
|
2021-04-18 21:51:47 +02:00
|
|
|
- name: Prepare CMake
|
|
|
|
run: |
|
2022-09-24 22:14:04 +02:00
|
|
|
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off
|
2022-05-15 12:42:29 +02:00
|
|
|
env:
|
2023-02-15 19:46:13 +01:00
|
|
|
CC: clang-16
|
|
|
|
CXX: clang++-16
|
2021-04-18 21:51:47 +02:00
|
|
|
|
2022-01-04 15:45:36 +01:00
|
|
|
- name: Prepare CMake dependencies
|
2021-04-18 21:51:47 +02:00
|
|
|
run: |
|
|
|
|
# make sure the precompiled headers exist
|
2023-02-08 21:11:11 +01:00
|
|
|
make -C cmake.output/cli cmake_pch.hxx.pch
|
2023-02-08 08:19:21 +01:00
|
|
|
make -C cmake.output/gui cmake_pch.hxx.pch
|
2022-05-15 12:42:29 +02:00
|
|
|
make -C cmake.output/lib cmake_pch.hxx.pch
|
|
|
|
make -C cmake.output/test cmake_pch.hxx.pch
|
2022-01-04 15:45:36 +01:00
|
|
|
# make sure the auto-generated GUI sources exist
|
2021-10-31 20:15:32 +01:00
|
|
|
make -C cmake.output autogen
|
2022-01-04 15:45:36 +01:00
|
|
|
|
|
|
|
- name: Clang-Tidy
|
|
|
|
run: |
|
2021-04-18 21:51:47 +02:00
|
|
|
cmake --build cmake.output --target run-clang-tidy 2> /dev/null
|