-
-
Notifications
You must be signed in to change notification settings - Fork 413
276 lines (265 loc) · 9.97 KB
/
build-test.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: Build QOwnNotes
on:
push:
branches-ignore:
- release
tags-ignore:
- '*'
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-paths
# if [[ ${changed_file} = src* ]] || [[ ${changed_file} = tests* ]] || [[ ${changed_file} = build-systems/github/* ]] || [[ ${changed_file} = ".github/workflows/build-test.yml" ]] ;
paths:
- 'src/**'
- 'snap/**'
- 'tests/**'
- 'build-systems/github/**'
- '.github/workflows/build-test.yml'
pull_request:
paths:
- 'src/**'
- 'snap/**'
- 'tests/**'
workflow_dispatch:
# schedule:
# - cron: "0 0 */3 * *"
defaults:
run:
working-directory: src
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
# Linux: https://download.qt.io/online/qtsdkrepository/linux_x64/desktop/
# macOS: https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/
# Windows: https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/
qt-version: ['5.9.9', '5.13.2', '5.14.2', '5.15.2', '6.2.4', '6.4.3', '6.5.3', '6.6.3']
experimental: [false]
exclude:
# Failing SSL Tests
- os: ubuntu-latest
qt-version: '5.9.9'
# tests.exe not found
- os: windows-2019
qt-version: '5.9.9'
# we want to do it Qt 6.2.0
- os: windows-2019
qt-version: '6.2.4'
experimental: false
# we want to do it with "experimental: true"
- os: windows-2019
qt-version: '6.4.3'
experimental: false
# we want to do it with "experimental: true"
- os: windows-2019
qt-version: '6.5.3'
experimental: false
- os: windows-2019
qt-version: '6.6.3'
experimental: false
# Qt6 builds of macOS are currently breaking because of the workaround for https://bugreports.qt.io/browse/QTBUG-117225
# See https://github.com/pbek/QOwnNotes/issues/3018
- os: macos-latest
qt-version: '6.2.4'
experimental: false
- os: macos-latest
qt-version: '6.4.3'
experimental: false
- os: macos-latest
qt-version: '6.5.3'
experimental: false
- os: macos-latest
qt-version: '6.6.3'
experimental: false
# Qt installation times out too often
# - os: windows-2019
# qt-version: '5.13.2'
# win64_mingw73 not found
# - os: windows-2019
# qt-version: '5.15.0'
# # qt.conf not found (https://github.com/jurplel/install-qt-action/issues/54)
# - os: windows-2019
# qt-version: '5.15.1'
# botan 32bit error
include:
# - os: ubuntu-latest
# qt-version: '6.3.0'
# experimental: true
# - os: macos-latest
# qt-version: '6.3.0'
# experimental: true
# Other 6.2 releases didn't work
- os: windows-2019
qt-version: '6.2.4'
experimental: true
- os: windows-2019
qt-version: '6.4.3'
experimental: true
- os: windows-2019
qt-version: '6.5.3'
experimental: true
- os: windows-2019
qt-version: '6.6.3'
experimental: true
# Qt6 builds of macOS are currently breaking because of the workaround for https://bugreports.qt.io/browse/QTBUG-117225
# See https://github.com/pbek/QOwnNotes/issues/3018
- os: macos-latest
qt-version: '6.2.4'
experimental: true
- os: macos-latest
qt-version: '6.4.3'
experimental: true
- os: macos-latest
qt-version: '6.5.3'
experimental: true
- os: macos-latest
qt-version: '6.6.3'
experimental: true
# Snapcraft
- os: ubuntu-22.04
qt-version: '5.15.2'
experimental: false
steps:
- uses: actions/checkout@v4
with:
submodules: true
#
# Install Qt
#
# https://github.com/jurplel/install-qt-action
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '5.9.9' )
name: Install Qt 5.9 on Windows
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
arch: win32_mingw53
cache: true
aqtversion: '==0.9.4'
- if: contains( matrix.os, 'windows') && ( ( matrix.qt-version == '5.13.2' ) || ( matrix.qt-version == '5.14.2' ) )
name: Install Qt on Windows
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
arch: win64_mingw73
cache: true
- if: contains( matrix.os, 'windows') && matrix.qt-version == '5.15.2'
name: Install Qt 5.15.2 on Windows
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
arch: win64_mingw81
cache: true
- if: contains( matrix.os, 'windows') && matrix.qt-version == '6.2.4'
name: Install Qt Qt 6.2.4 on Windows
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
arch: win64_mingw
modules: qtwebsockets
cache: true
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version != '6.2.4'
name: Install Qt 6 on Windows
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==2.1.*'
version: ${{ matrix.qt-version }}
arch: win64_mingw
modules: qtwebsockets
cache: true
- if: false == contains( matrix.os, 'windows') && false == startsWith( matrix.qt-version, '6.' )
name: Install Qt < 6 on Linux/macOS
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
cache: true
- if: false == contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' )
name: Install Qt 6 on Linux/macOS
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
modules: qtwebsockets
cache: true
#
# Do tests
#
- if: contains( matrix.os, 'ubuntu-latest')
name: Do Linux tests
run: |
cd ../tests && qmake CONFIG+=debug CONFIG+=DEV_MODE DEFINES+=INTEGRATION_TESTS && make -s -j 8
../bin/tests/tests -platform minimal -txt
# qmake workaround: https://bugreports.qt.io/browse/QTBUG-117225?focusedId=754625&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-754625
# See https://github.com/pbek/QOwnNotes/issues/3018
- if: contains( matrix.os, 'macos')
name: Do macOS tests
run: |
cd ../tests && qmake CONFIG+=debug CONFIG+=DEV_MODE DEFINES+=INTEGRATION_TESTS -early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib && make -s -j 8
../bin/tests/tests.app/Contents/MacOS/tests -platform minimal -txt
- if: contains( matrix.os, 'windows') && (startsWith( matrix.qt-version, '5.' ) || matrix.qt-version == '6.2.4')
name: Do Qt5 / Qt 6.2.4 Windows tests
run: |
cd ..\tests
qmake DEFINES+=INTEGRATION_TESTS
make
copy ..\build-systems\github\windows\libcrypto-1_1-x64.dll .
copy ..\build-systems\github\windows\libssl-1_1-x64.dll .
copy ..\bin\tests\tests.exe .
# echo set
# gci env:* | sort-object name
# echo path
# echo echo $env:PATH
# cd ..\bin\tests
# echo test1
# .\tests.exe -txt
# echo windeployqt
windeployqt --debug tests.exe
# echo test2
.\tests.exe -txt
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version != '6.2.4'
name: Do Qt 6.3+ Windows tests
run: |
cd ..\tests
qmake6 DEFINES+=INTEGRATION_TESTS
make
copy ..\build-systems\github\windows\libcrypto-1_1-x64.dll .
copy ..\build-systems\github\windows\libssl-1_1-x64.dll .
copy ..\bin\tests\tests.exe .
windeployqt --debug tests.exe
.\tests.exe -txt
#
# Build QOwnNotes
#
- if: true && !(contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' )) && !contains( matrix.os, 'ubuntu-22') && !contains( matrix.os, 'macos')
name: Build QOwnNotes
run: |
lrelease QOwnNotes.pro && qmake CONFIG+=debug CONFIG+=DEV_MODE && make -j 8
# qmake workaround: https://bugreports.qt.io/browse/QTBUG-117225?focusedId=754625&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-754625
# See https://github.com/pbek/QOwnNotes/issues/3018
- if: contains( matrix.os, 'macos')
name: Build QOwnNotes for macOS with qmake fix
run: |
lrelease QOwnNotes.pro && qmake CONFIG+=debug CONFIG+=DEV_MODE -early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib && make -j 8
../build-systems/github/macos/create-dmg.sh
# - if: contains( matrix.os, 'ubuntu-22')
# name: Build QOwnNotes Ubuntu 20.04
# run: |
# lrelease QOwnNotes.pro && qmake CONFIG+=release && make -j 8
- if: contains( matrix.os, 'ubuntu-22')
name: Build for Snapcraft
uses: snapcore/action-build@v1
#
# Build QOwnNotes Windows Release and store it as artifact
#
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' )
name: Build QOwnNotes Windows Release
run: '& ..\build-systems\github\windows\build-zip.ps1'
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' )
uses: actions/upload-artifact@v4
with:
name: QOwnNotes-Windows
path: QOwnNotes.zip