Skip to content

Commit

Permalink
ci: split build.yml into build-qt5 and build-qt6
Browse files Browse the repository at this point in the history
So macOS self-hosted runner can run the Qt6 part. It doesn't
have Qt5 installed
  • Loading branch information
iamsergio committed Jan 17, 2025
1 parent 7f16284 commit 8cbd7ca
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 12 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/build-qt5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

name: Build (Qt5)

on:
push:
paths-ignore:
# These are built by another workflow
- src/flutter/**
- tests/flutter/**
- examples/flutter/**
- tests/reference-images/**
- .github/workflows/create_release.yml
- .github/workflows/examples.yml
branches:
- main
- 2.2
pull_request:
branches:
- main
- 2.2
workflow_dispatch:

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

preset:
- name: ci-dev-qt5
qt_version: "5.15"
- name: ci-release-qt5
qt_version: "5.15"
- name: ci-qtwidgets-qt5
qt_version: "5.15"
- name: ci-qtquick-qt5
qt_version: "5.15"

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

- name: Install Qt ${{ matrix.preset.qt_version }} with options and default aqtversion
uses: jurplel/install-qt-action@v4
if: env.IS_SELFHOSTED != 1
with:
version: ${{ matrix.preset.qt_version }}
cache: true

- name: Install spdlog on Ubuntu
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install libspdlog-dev -y
- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main

- 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-${{ matrix.preset.name }} --preset ${{ matrix.preset.name }}

- name: Build Project ${{ matrix.preset.build_preset_arg }}
run: cmake --build ./build-${{ matrix.preset.name }} ${{ matrix.preset.build_preset_arg }}

- name: Run tests on Linux
if: ${{ startsWith(matrix.preset.name, 'ci-dev-') && runner.os == 'Linux' }}
run: ctest --test-dir ./build-${{ matrix.preset.name }} --verbose
env:
QT_QUICK_BACKEND: software
LSAN_OPTIONS: detect_leaks=${{ matrix.preset.detect_leaks }}

- name: Run tests on Window/macOS
if: ${{ startsWith(matrix.preset.name, 'ci-dev-') && runner.os != 'Linux' }}
run: ctest --test-dir ./build-${{ matrix.preset.name }} --verbose

- 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"
21 changes: 9 additions & 12 deletions .github/workflows/build.yml → .github/workflows/build-qt6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

name: CI
name: Build (Qt6)

on:
push:
Expand Down Expand Up @@ -30,19 +30,11 @@ jobs:
fail-fast: true
matrix:
os:
- ubuntu-latest
- ubuntu-24.04
- windows-latest
- macos-13
- macos-15

preset:
- name: ci-dev-qt5
qt_version: "5.15"
- name: ci-release-qt5
qt_version: "5.15"
- name: ci-qtwidgets-qt5
qt_version: "5.15"
- name: ci-qtquick-qt5
qt_version: "5.15"
- name: ci-dev-qt6
qt_version: "6.3.*"
- name: ci-release-qt6
Expand Down Expand Up @@ -92,9 +84,14 @@ jobs:
if: ${{ matrix.preset.pip_pgks }}
run: echo ${{ join(matrix.preset.pip_pgks, ' ') }} | xargs pip install

- name: Install ninja-build tool (must be after Qt due PATH changes)
- 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

Expand Down

0 comments on commit 8cbd7ca

Please sign in to comment.