forked from pbek/QOwnNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
187 lines (176 loc) · 6.73 KB
/
build-test.yml
File metadata and controls
187 lines (176 loc) · 6.73 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
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
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-16.04, ubuntu-latest, macos-latest, windows-latest]
# 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']
experimental: [false]
exclude:
# We only want to built in Qt 5.5.1 of Ubuntu 16.04
- os: ubuntu-16.04
# Failing SSL Tests
- os: ubuntu-latest
qt-version: '5.9.9'
# tests.exe not found
- os: windows-latest
qt-version: '5.9.9'
# Qt installation times out too often
# - os: windows-latest
# qt-version: '5.13.2'
# win64_mingw73 not found
# - os: windows-latest
# qt-version: '5.15.0'
# # qt.conf not found (https://github.com/jurplel/install-qt-action/issues/54)
# - os: windows-latest
# qt-version: '5.15.1'
# botan 32bit error
include:
- os: ubuntu-16.04
qt-version: '5.5.1'
experimental: false
- os: ubuntu-latest
qt-version: '6.2.0'
experimental: true
- os: macos-latest
qt-version: '6.2.0'
experimental: true
- os: windows-latest
qt-version: '6.2.0'
experimental: true
steps:
- uses: actions/checkout@v2
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
if [ "${{ matrix.os }}" = "ubuntu-16.04" ]; then
DO_BUILD='true'
else
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
fi
echo "DO_BUILD: ${DO_BUILD}"
echo ::set-output name=DO_BUILD::${DO_BUILD}
#
# Install Qt
#
- if: steps.changes.outputs.DO_BUILD && matrix.os == 'ubuntu-16.04'
name: Install Qt 5.5.1 on Ubuntu 16.04
run: |
sudo apt install g++ libc6 qt5-default libqt5qml5 qtdeclarative5-dev qt5-qmake libqt5xml5 libqt5xmlpatterns5 libqt5xmlpatterns5-dev qttools5-dev build-essential libqt5svg5-dev qttools5-dev-tools libqt5websockets5-dev libqt5x11extras5-dev
- if: steps.changes.outputs.DO_BUILD && matrix.os != 'ubuntu-16.04'
name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}
# 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' ) || ( matrix.qt-version == '6.2.0' )) && steps.changes.outputs.DO_BUILD
name: Install Qt > 5.15.2 on Windows
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt-version }}
arch: win64_mingw81
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- if: false == contains( matrix.os, 'windows') && matrix.os != 'ubuntu-16.04' && steps.changes.outputs.DO_BUILD
name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt-version }}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
#
# Do tests
#
- if: contains( matrix.os, 'ubuntu') && ( matrix.qt-version != '5.5.1' ) && steps.changes.outputs.DO_BUILD
name: Do Linux tests
run: |
cd ../tests && qmake DEFINES+=INTEGRATION_TESTS && make -s -j 2
../bin/tests/tests -platform minimal -txt
- if: contains( matrix.os, 'macos') && steps.changes.outputs.DO_BUILD
name: Do macOS tests
run: |
cd ../tests && qmake DEFINES+=INTEGRATION_TESTS && make -s -j 2
../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 .
windeployqt tests.exe
.\tests.exe -txt
#
# Build QOwnNotes
#
- if: steps.changes.outputs.DO_BUILD && !(contains( matrix.os, 'windows') && ( matrix.qt-version == '5.15.2' ))
name: Build QOwnNotes
run: |
lrelease QOwnNotes.pro && qmake && make
#
# 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@v2
with:
name: QOwnNotes-Windows
path: QOwnNotes.zip