forked from pbek/QOwnNotes
-
Notifications
You must be signed in to change notification settings - Fork 1
219 lines (207 loc) · 7.83 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
name: Build QOwnNotes
on:
push:
branches-ignore:
- master
tags-ignore:
- '*'
pull_request:
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']
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'
# 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.3.0'
# experimental: true
# Snapcraft
- os: ubuntu-18.04
qt-version: '5.15.2'
experimental: false
steps:
- uses: actions/checkout@v3
with:
submodules: true
- id: files
uses: jitterbit/get-changed-files@v1
with:
format: 'csv'
- if: contains( matrix.os, 'macos')
name: Install bash 5.0 under macOS for mapfile
run: |
brew install bash
sudo mv /usr/local/bin/bash /bin/bash
- id: changes
name: Check if we want to build QOwnNotes
shell: bash
run: |
unset DO_BUILD
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.files.outputs.added_modified }}')
for changed_file in "${added_modified_files[@]}"; do
if [[ ${changed_file} = src* ]] || [[ ${changed_file} = tests* ]] || [[ ${changed_file} = build-systems/github/* ]] || [[ ${changed_file} = ".github/workflows/build-test.yml" ]] ;
then
echo "'${changed_file}' matches, we will build"
DO_BUILD='true'
fi
done
echo "DO_BUILD: ${DO_BUILD}"
echo ::set-output name=DO_BUILD::${DO_BUILD}
- if: contains( matrix.os, 'ubuntu-18') && steps.changes.outputs.DO_BUILD
name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
use_lxd: true
#
# Install Qt
#
- if: steps.changes.outputs.DO_BUILD
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' ) && steps.changes.outputs.DO_BUILD
name: Install Qt 5.9 on Windows
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt-version }}
arch: win32_mingw53
cached: ${{ 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' ) ) && steps.changes.outputs.DO_BUILD
name: Install Qt on Windows
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt-version }}
arch: win64_mingw73
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' ) && steps.changes.outputs.DO_BUILD
name: Install Qt 5.15.2 on Windows
uses: jurplel/install-qt-action@v2
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
arch: win64_mingw81
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '6.2.4' ) && steps.changes.outputs.DO_BUILD
name: Install Qt 6.2.4 on Windows
uses: jurplel/install-qt-action@v2
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
arch: win64_mingw81
modules: qtwebsockets
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- if: false == contains( matrix.os, 'windows') && ( matrix.qt-version != '6.2.4' ) && steps.changes.outputs.DO_BUILD
name: Install Qt < 6 on Linux/macOS
uses: jurplel/install-qt-action@v2
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- if: false == contains( matrix.os, 'windows') && ( matrix.qt-version == '6.2.4' ) && steps.changes.outputs.DO_BUILD
name: Install Qt 6.2.4 on Linux/macOS
uses: jurplel/install-qt-action@v2
with:
aqtversion: '==2.0.0'
version: ${{ matrix.qt-version }}
modules: qtwebsockets
cached: ${{ steps.cache-qt.outputs.cache-hit }}
#
# Do tests
#
- if: contains( matrix.os, 'ubuntu-latest') && steps.changes.outputs.DO_BUILD
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') && steps.changes.outputs.DO_BUILD
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') && steps.changes.outputs.DO_BUILD
name: Do 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
#
# Build QOwnNotes
#
- if: steps.changes.outputs.DO_BUILD && !(contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' )) && !contains( matrix.os, 'ubuntu-18')
name: Build QOwnNotes
run: |
lrelease QOwnNotes.pro && qmake CONFIG+=debug CONFIG+=DEV_MODE && make -j 8
- if: steps.changes.outputs.DO_BUILD && contains( matrix.os, 'ubuntu-18')
name: Build QOwnNotes Ubuntu 18.04
run: |
lrelease QOwnNotes.pro && qmake CONFIG+=release && make -j 8
- if: contains( matrix.os, 'ubuntu-18') && steps.changes.outputs.DO_BUILD
name: Build for Snapcraft
run: make clean && cd .. && sg lxd -c 'snapcraft --use-lxd' && ls
#
# Build QOwnNotes Windows Release and store it as artifact
#
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' ) && steps.changes.outputs.DO_BUILD
name: Build QOwnNotes Windows Release
run: '& ..\build-systems\github\windows\build-zip.ps1'
- if: contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' ) && steps.changes.outputs.DO_BUILD
uses: actions/upload-artifact@v3
with:
name: QOwnNotes-Windows
path: QOwnNotes.zip