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]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2022-05-31 19:55:57 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-04-18 21:51:47 +02:00
|
|
|
|
2021-04-24 20:20:09 +02:00
|
|
|
container:
|
2022-05-22 15:27:32 +02:00
|
|
|
image: "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:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install missing software
|
|
|
|
run: |
|
2021-04-24 20:20:09 +02:00
|
|
|
apt-get update
|
2022-05-22 15:27:32 +02:00
|
|
|
apt-get install -y cmake clang-14 make
|
2021-04-24 20:20:09 +02:00
|
|
|
apt-get install -y libpcre3-dev
|
2021-10-31 20:15:32 +01:00
|
|
|
apt-get install -y libffi7 # work around missing dependency for Qt install step
|
2022-05-22 15:27:32 +02:00
|
|
|
apt-get install -y clang-tidy-14
|
2021-04-24 20:20:09 +02:00
|
|
|
|
2022-02-01 17:26:52 +01:00
|
|
|
- name: Cache Qt ${{ env.QT_VERSION }}
|
|
|
|
id: cache-qt
|
|
|
|
uses: actions/cache@v1 # not v2!
|
|
|
|
with:
|
|
|
|
path: ../Qt
|
|
|
|
key: Linux-QtCache-${{ env.QT_VERSION }}-qtcharts
|
|
|
|
|
|
|
|
- name: Install Qt ${{ env.QT_VERSION }}
|
2021-10-31 20:15:32 +01:00
|
|
|
uses: jurplel/install-qt-action@v2
|
|
|
|
with:
|
|
|
|
install-deps: 'nosudo'
|
2022-02-01 17:26:52 +01:00
|
|
|
version: ${{ env.QT_VERSION }}
|
2021-10-31 20:15:32 +01:00
|
|
|
modules: 'qtcharts'
|
2022-02-01 17:26:52 +01:00
|
|
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
2021-04-18 21:51:47 +02:00
|
|
|
|
|
|
|
- name: Prepare CMake
|
|
|
|
run: |
|
|
|
|
mkdir cmake.output
|
|
|
|
cd cmake.output
|
2022-04-11 07:30:55 +02:00
|
|
|
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off ..
|
2021-04-18 21:51:47 +02:00
|
|
|
cd ..
|
2022-05-15 12:42:29 +02:00
|
|
|
env:
|
2022-05-22 15:27:32 +02:00
|
|
|
CC: clang-14
|
|
|
|
CXX: clang++-14
|
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
|
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
|