Skip to content

Commit

Permalink
CI: Build QML with module support
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsergio committed Jan 25, 2025
1 parent 90fdb3d commit 91fbc6b
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 35 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/qml-module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

# Tests that building KDDW as a QML module works

name: QML module

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-24.04

steps:
- name: Export IS_SELFHOSTED
run: echo "IS_SELFHOSTED=$IS_SELFHOSTED" >> $GITHUB_ENV

- name: Install Qt
uses: jurplel/install-qt-action@v4
if: env.IS_SELFHOSTED != 1
with:
version: 6.8.1
cache: true

- name: Install spdlog on Ubuntu
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install libspdlog-dev -y
- name: Install ninja (Windows / Linux)
if: ${{ runner.os != 'macOS' }}
uses: turtlesec-no/get-ninja@main

- name: Install ninja (macOS)
if: ${{ runner.os == 'macOS' }}
run: brew install ninja

- name: Checkout sources
uses: actions/checkout@v4

- name: Make sure MSVC is found when Ninja generator is in use
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1

- name: Configure project
run: cmake -S . -B ./build --preset ci-qtquick-module-qt6

- name: Build Project
run: cmake --build ./build

- name: qmllint
run: ninja all_qmllint

- name: Run tests on Linux
run: ctest --test-dir ./build --verbose
env:
QT_QUICK_BACKEND: software
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ option(KDDockWidgets_FLUTTER_TESTS_AOT "Flutter tests will be built in AOT mode"
option(KDDockWidgets_NO_SPDLOG "Don't use spdlog, even if it is found." OFF)
option(KDDockWidgets_USE_LLD "Use lld for linking" OFF)
option(KDDockWidgets_USE_VALGRIND "Runs the tests under valgrind" OFF)
option(KDDockWidgets_QML_MODULE "The QtQuick support will be built as a QML module" ON) # change to off!
option(KDDockWidgets_QML_MODULE "The QtQuick support will be built as a QML module" OFF)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/ECM/modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/KDAB/modules")
Expand Down
Loading

0 comments on commit 91fbc6b

Please sign in to comment.