cppcheck/.github/workflows/clang-tidy.yml

74 lines
2.1 KiB
YAML
Raw Normal View History

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:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
2021-04-18 21:51:47 +02:00
permissions:
contents: read
2021-04-18 21:51:47 +02:00
jobs:
build:
runs-on: ubuntu-22.04
2021-04-18 21:51:47 +02:00
env:
QT_VERSION: 6.5.3
2021-04-18 21:51:47 +02:00
steps:
- uses: actions/checkout@v3
2021-04-18 21:51:47 +02:00
- name: Install missing software
run: |
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: |
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
2023-08-09 12:45:15 +02:00
sudo ./llvm.sh 17
sudo apt-get install -y clang-tidy-17
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
modules: 'qtcharts'
cache: true
2021-04-18 21:51:47 +02:00
- name: Verify clang-tidy configuration
run: |
2023-08-09 12:45:15 +02:00
clang-tidy-17 --verify-config
2021-04-18 21:51:47 +02:00
- name: Prepare CMake
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off
env:
2023-08-09 12:45:15 +02:00
CC: clang-17
CXX: clang++-17
2021-04-18 21:51:47 +02:00
- name: Prepare CMake dependencies
2021-04-18 21:51:47 +02:00
run: |
# make sure the precompiled headers exist
make -C cmake.output/cli cmake_pch.hxx.pch
make -C cmake.output/gui cmake_pch.hxx.pch
make -C cmake.output/lib cmake_pch.hxx.pch
make -C cmake.output/test cmake_pch.hxx.pch
# make sure the auto-generated GUI sources exist
make -C cmake.output autogen
- name: Clang-Tidy
run: |
2021-04-18 21:51:47 +02:00
cmake --build cmake.output --target run-clang-tidy 2> /dev/null