-
-
Notifications
You must be signed in to change notification settings - Fork 425
237 lines (226 loc) · 8.21 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
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.0', '6.4.2', '6.5.0', '6.6.0']
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 with "experimental: true"
- os: windows-2019
qt-version: '6.4.2'
experimental: false
# we want to do it with "experimental: true"
- os: windows-2019
qt-version: '6.5.0'
experimental: false
- os: windows-2019
qt-version: '6.6.0'
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
- os: windows-2019
qt-version: '6.4.2'
experimental: true
- os: windows-2019
qt-version: '6.5.0'
experimental: true
- os: windows-2019
qt-version: '6.6.0'
experimental: true
# Snapcraft
- os: ubuntu-20.04
qt-version: '5.15.2'
experimental: false
steps:
- uses: actions/checkout@v4
with:
submodules: true
#
# Install Qt
#
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
with:
path: ../Qt
key: ${{ matrix.os }}-QtCache-${{ matrix.qt-version }}-2
# 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@v3
with:
version: ${{ matrix.qt-version }}
arch: win32_mingw53
cache: ${{ steps.cache-qt.outputs.cache-hit }}
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@v3
with:
version: ${{ matrix.qt-version }}
arch: win64_mingw73
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- if: contains( matrix.os, 'windows') && matrix.qt-version == '5.15.2'
name: Install Qt 5.15.2 on Windows
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
arch: win64_mingw81
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- if: contains( matrix.os, 'windows') && matrix.qt-version == '6.2.0'
name: Install Qt Qt 6.2.0 on Windows
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
arch: win64_mingw81
modules: qtwebsockets qt5compat
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version != '6.2.0'
name: Install Qt 6 on Windows
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.1.*'
version: ${{ matrix.qt-version }}
arch: win64_mingw
modules: qtwebsockets qt5compat
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- if: false == contains( matrix.os, 'windows') && false == startsWith( matrix.qt-version, '6.' )
name: Install Qt < 6 on Linux/macOS
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
cache: ${{ steps.cache-qt.outputs.cache-hit }}
- if: false == contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' )
name: Install Qt 6 on Linux/macOS
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
modules: qtwebsockets qt5compat
cache: ${{ steps.cache-qt.outputs.cache-hit }}
#
# 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
- if: contains( matrix.os, 'macos')
name: Do macOS tests
run: |
cd ../tests && qmake CONFIG+=debug CONFIG+=DEV_MODE DEFINES+=INTEGRATION_TESTS && 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.0')
name: Do Qt5 / Qt 6.2.0 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.0'
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-20')
name: Build QOwnNotes
run: |
lrelease QOwnNotes.pro && qmake CONFIG+=debug CONFIG+=DEV_MODE && make -j 8
# - if: contains( matrix.os, 'ubuntu-20')
# name: Build QOwnNotes Ubuntu 20.04
# run: |
# lrelease QOwnNotes.pro && qmake CONFIG+=release && make -j 8
- if: contains( matrix.os, 'ubuntu-20')
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@v3
with:
name: QOwnNotes-Windows
path: QOwnNotes.zip