From dafb2fe6a0c539ba20cdea34bf5db2c06d5033a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 15 Dec 2021 19:36:34 +0100 Subject: [PATCH] Test GUI build CMake in CI (#3621) --- .github/workflows/CI-unixish-docker.yml | 4 ++-- .github/workflows/CI-unixish.yml | 18 ++++++++++++++---- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/format.yml | 4 ++-- gui/translationhandler.cpp | 9 --------- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 55fdadd52..eda91e35d 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -40,7 +40,7 @@ jobs: mkdir cmake.output cd cmake.output cmake -G "Unix Makefiles" -DHAVE_RULES=On .. - make -j$(nproc) + cmake --build . -- -j$(nproc) cd .. - name: Test CMake build @@ -49,7 +49,7 @@ jobs: mkdir cmake.output cd cmake.output cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On .. - make -j$(nproc) check + cmake --build . --target check -- -j$(nproc) cd .. - name: Build cppcheck diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index 9caf53a76..a712cf566 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -49,17 +49,27 @@ jobs: python -m pip install pytest - name: Install Qt - if: contains(matrix.os, 'ubuntu') uses: jurplel/install-qt-action@v2 with: + version: '5.15.2' modules: 'qtcharts' - - name: Test CMake build + - name: Test CMake build (with GUI) run: | mkdir cmake.output cd cmake.output - cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On .. - make -j$(nproc) check + cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On .. + cmake --build . -- -j$(nproc) + cd .. + + - name: Run CMake test + run: | + cmake --build cmake.output --target check -- -j$(nproc) + + - name: Run CTest + run: | + cd cmake.output + ctest -j$(nproc) cd .. - name: Build and test with Unsigned char diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 3cbb5effc..be94851ed 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -38,7 +38,7 @@ jobs: run: | mkdir cmake.output cd cmake.output - cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On .. + cmake -G "Unix Makefiles" -DUSE_Z3=On -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On .. cd .. - name: Clang-Tidy diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 8d5f8a19b..8b1a02baf 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -27,8 +27,8 @@ jobs: tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0 mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j$(nproc) -s + cmake -DCMAKE_BUILD_TYPE=Release .. + cmake --build . -- -j$(nproc) -s mkdir ~/uncrustify cp uncrustify ~/uncrustify/ diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp index 5cd30d1e5..066ee00b9 100644 --- a/gui/translationhandler.cpp +++ b/gui/translationhandler.cpp @@ -31,19 +31,10 @@ static void unused() { // NOTE: Keeping semi-colons at end of macro for style preference -#if ((QT_VERSION >= 0x040000) && (QT_VERSION < 0x050000)) - Q_UNUSED(QT_TRANSLATE_NOOP("QDialogButtonBox", "OK")); - Q_UNUSED(QT_TRANSLATE_NOOP("QDialogButtonBox", "Cancel")); - Q_UNUSED(QT_TRANSLATE_NOOP("QDialogButtonBox", "Close")); - Q_UNUSED(QT_TRANSLATE_NOOP("QDialogButtonBox", "Save")); -#elif ((QT_VERSION >= 0x050000) && (QT_VERSION < 0x060000)) Q_UNUSED(QT_TRANSLATE_NOOP("QPlatformTheme", "OK")); Q_UNUSED(QT_TRANSLATE_NOOP("QPlatformTheme", "Cancel")); Q_UNUSED(QT_TRANSLATE_NOOP("QPlatformTheme", "Close")); Q_UNUSED(QT_TRANSLATE_NOOP("QPlatformTheme", "Save")); -#else -#error Unsupported Qt version. -#endif } TranslationHandler::TranslationHandler(QObject *parent) :