-
Notifications
You must be signed in to change notification settings - Fork 170
143 lines (125 loc) · 4.66 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# 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: CI
on:
push:
branches:
- 2.1
- 2.0
- main
pull_request:
branches:
- 2.1
- 2.0
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
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
qt_version: "6.3.*"
- name: ci-qtwidgets-qt6
qt_version: "6.3.*"
- name: ci-qtquick-qt6
qt_version: "6.3.*"
include:
- os: ubuntu-latest
preset:
name: ci-dev-asan-qt5
qt_version: "5.15"
detect_leaks: 0
apt_pgks:
- lld
- os: ubuntu-latest
preset:
name: ci-python-qt6
qt_version: "6.6.0"
detect_leaks: 0
apt_pgks:
- llvm
pip_pgks:
- shiboken6-generator==6.6.0 pyside6==6.6.0
- os: ubuntu-latest
preset:
name: ci-dev-asan-qtwidgets-qt6
qt_version: "6.5.*"
detect_leaks: 1
apt_pgks:
- lld
- os: ubuntu-latest
preset:
name: ci-dev-asan-qtquick-qt6
qt_version: "6.5.*"
detect_leaks: 1
apt_pgks:
- lld
steps:
- name: Install Qt ${{ matrix.preset.qt_version }} with options and default aqtversion
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.preset.qt_version }}
cache: true
- name: Install dependencies on Ubuntu (${{ join(matrix.preset.apt_pgks, ' ') }})
if: ${{ runner.os == 'Linux' && matrix.preset.apt_pgks }}
run: |
sudo apt update -qq
echo ${{ join(matrix.preset.apt_pgks, ' ') }} | xargs sudo apt install -y
# Not using apt_pgks, since spdlog is needed for all configurations:
- name: Install spdlog on Ubuntu
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install libspdlog-dev -y
- name: Install Python dependencies (${{ join(matrix.preset.pip_pgks, ' ') }})
if: ${{ matrix.preset.pip_pgks }}
run: echo ${{ join(matrix.preset.pip_pgks, ' ') }} | xargs pip install
- name: Hackery due Shiboken hardcoded paths
if: ${{ matrix.preset.pip_pgks }}
run: |
sudo mkdir -p /opt/rh/gcc-toolset-10/root/usr/bin/
sudo cp /usr/bin/g++-10 /opt/rh/gcc-toolset-10/root/usr/bin/c++
sudo mkdir -p /opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-linux-gnu/10/
sudo cp /usr/lib/gcc/x86_64-linux-gnu/10/cc1plus /opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-linux-gnu/10/
- 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 (offscreen)
if: ${{ startsWith(matrix.preset.name, 'ci-dev-') && runner.os == 'Linux' }}
run: ctest --test-dir ./build-${{ matrix.preset.name }} --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
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 }} --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"