-
Notifications
You must be signed in to change notification settings - Fork 42
134 lines (113 loc) · 4.33 KB
/
Copy pathbuild.yml
File metadata and controls
134 lines (113 loc) · 4.33 KB
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
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
#
# SPDX-License-Identifier: MIT
name: CI
on:
push:
branches:
- master
- kdchart-3.0
pull_request:
branches:
- master
- kdchart-3.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- windows-2022
- macos-latest
build_type:
- Debug
# - Release
link_type:
- shared
#- static
config:
- qt_version: 5.15.2
architectures: "x86_64"
- qt_version: 6.9.3
architectures: "x86_64;arm64"
exclude:
# Qt 5.15.2 uses stdext::checked_array_iterator, which Visual Studio
# 2025 removed, so it only builds on the older image
- os: windows-latest
config:
qt_version: 5.15.2
architectures: "x86_64"
- os: windows-2022
config:
qt_version: 6.9.3
architectures: "x86_64;arm64"
include:
- os: ubuntu-22.04
build_type: Release
link_type: shared
config:
qt_version: 6.6.0
architectures: "x86_64"
apt_pgks:
- llvm
pip_pgks:
- shiboken6-generator==6.6.0 pyside6==6.6.0
steps:
- name: Install Qt with options and default aqtversion
uses: jurplel/install-qt-action@v4
with:
aqtversion: null # use whatever the default is
version: ${{ matrix.config.qt_version }}
cache: true
- name: Checkout sources
uses: actions/checkout@v6
- name: Install dependencies on Ubuntu (${{ join(matrix.config.apt_pgks, ' ') }})
if: ${{ runner.os == 'Linux' && matrix.config.apt_pgks }}
run: |
sudo apt update -qq
echo ${{ join(matrix.config.apt_pgks, ' ') }} | xargs sudo apt install -y
- name: Install Python dependencies (${{ join(matrix.config.pip_pgks, ' ') }})
if: ${{ matrix.config.pip_pgks }}
run: echo ${{ join(matrix.config.pip_pgks, ' ') }} | xargs pip install
- name: Hackery due Shiboken hardcoded paths
if: ${{ matrix.config.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: Make sure MSVC is found when Ninja generator is in use
uses: ilammy/msvc-dev-cmd@v1
- name: Configure project
run: >
cmake -S . -B ./build -G Ninja
--warn-uninitialized -Werror=dev
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.config.architectures }}"
-DKDChart_QT6=${{ startsWith(matrix.config.qt_version, '6.') }}
-DKDChart_STATIC=${{ matrix.link_type == 'static' }}
-DKDChart_TESTS=${{ matrix.build_type == 'Debug' }}
-DKDChart_EXAMPLES=${{ matrix.build_type == 'Debug' }}
-DKDChart_DOCS=${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}
-DKDChart_PYTHON_BINDINGS=${{ matrix.config.pip_pgks }}
-DPython3_FIND_VIRTUALENV=ONLY
- name: Build Project
run: cmake --build ./build
- name: Run tests on Linux (offscreen)
if: ${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}
run: ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
- name: Run tests on Windown/macOS
if: ${{ matrix.build_type == 'Debug' && runner.os != 'Linux' }}
run: ctest --test-dir ./build -C ${{ matrix.build_type }} --output-on-failure
- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ failure() && matrix.build_type == 'Debug' }}
with:
path: "./build/Testing/Temporary/LastTest.log"