Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Fix build issues and use master branch #23

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ name: CI
on:
push:
branches:
- 2.0
- master
pull_request:
branches:
- 2.0
- master

jobs:
build:
Expand All @@ -19,17 +19,13 @@ jobs:
fail-fast: true
matrix:
os:
- ubuntu-22.04
- ubuntu-20.04
- windows-2022
- windows-2019
- macos-13
- macos-12
- ubuntu-latest
- windows-latest
- macos-latest

config:
- qt_version: "5.15"
- qt_version: "6.3.*"
- qt_version: "6.6.*"
- qt_version: "6.4.*" # Qt 6.5+ requires newer xcode 14.3.1 unavailabe atm

steps:
- name: Install Qt ${{ matrix.config.qt_version }} with options and default aqtversion
Expand All @@ -44,6 +40,9 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Fetch Git submodule
run: git submodule update --init --recursive

- name: Make sure MSVC is found when Ninja generator is in use
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -56,17 +55,17 @@ jobs:

- name: Run tests on Linux (offscreen)
if: ${{ runner.os == 'Linux' }}
run: ctest --test-dir ./build-${{ matrix.preset.name }} --output-on-failure
run: ctest --test-dir ./build --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
QT_QUICK_BACKEND: software

- name: Run tests on Window/macOS
if: ${{ runner.os != 'Linux' }}
run: ctest --test-dir ./build-${{ matrix.preset.name }} --output-on-failure
run: ctest --test-dir ./build --output-on-failure

- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ failure() && startsWith(matrix.preset.name, 'ci-dev-') }}
with:
path: "./build-${{ matrix.preset.name }}/Testing/Temporary/LastTest.log"
path: "./build/Testing/Temporary/LastTest.log"
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ project(KDToolBox LANGUAGES CXX)

option(KDTOOLBOX_CXX20 "Enabling C++20 tests" OFF)

include(GNUInstallDirs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand All @@ -18,14 +20,17 @@ set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE TRUE)
set(CMAKE_LINK_DEPENDS_NO_SHARED TRUE)

set(QT_REQUIRED_VERSION "5.15.0")
set(QT_VERSION_MAJOR 5) # KDAB CI fails with Qt6
if(NOT DEFINED QT_VERSION_MAJOR)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
endif()
find_package(Qt${QT_VERSION_MAJOR} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Core Gui)

set(CMAKE_AUTOMOC ON)

if (MSVC)
add_compile_options(/Zc:__cplusplus)
endif()

add_definitions(
-DQT_NO_CAST_TO_ASCII
-DQT_NO_CAST_FROM_ASCII
Expand Down
2 changes: 1 addition & 1 deletion cpp/propagate_const/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
find_package(Qt${QT_VERSION_MAJOR} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Core Test)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(tst_propagate_const_SOURCES tst_propagate_const.cpp)
Expand Down
9 changes: 7 additions & 2 deletions qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ add_subdirectory(model_view)
add_subdirectory(notify_guard)
add_subdirectory(pointer_cast)
add_subdirectory(qml)
add_subdirectory(qt_fmt)
add_subdirectory(qt_hasher)
add_subdirectory(singleshot_connect)
add_subdirectory(tabWindow)
add_subdirectory(ui_watchdog)
add_subdirectory(asan_assert_fail_qt)
add_subdirectory(qt6_natvis)

if(LINUX)
add_subdirectory(asan_assert_fail_qt)
endif()

if(QT_VERSION_MAJOR EQUAL 5)
# Qt6 has it's own QStringTokenizer
add_subdirectory(stringtokenizer)

# fails to build with with Qt6
add_subdirectory(qt_fmt)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#
# SPDX-License-Identifier: MIT
#

set(CMAKE_CXX_STANDARD 14)

find_package(
Qt${QT_VERSION_MAJOR}
${QT_REQUIRED_VERSION}
Expand Down
1 change: 1 addition & 0 deletions qt/qt6_natvis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
Expand Down
1 change: 1 addition & 0 deletions qt/qt6_natvis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QtCore>

#include <unordered_set>
#include <unordered_map>

int main(int argc, char *argv[])
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ void tst_QStringTokenizer::basics() const
QFETCH(const Qt::CaseSensitivity, cs);

auto expected = QStringList{
QStringLiteral(""), QStringLiteral("a"), QStringLiteral("b"), QStringLiteral("c"),
QStringLiteral("d"), QStringLiteral("e"), QStringLiteral(""),
QLatin1String(""), QStringLiteral("a"), QStringLiteral("b"), QStringLiteral("c"),
QStringLiteral("d"), QStringLiteral("e"), QLatin1String(""),
};
if (sb & Qt::SkipEmptyParts)
expected = skipped(expected);
Expand Down