-
Notifications
You must be signed in to change notification settings - Fork 0
250 lines (209 loc) · 7.16 KB
/
build.yaml
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
name: Build
on:
workflow_dispatch:
inputs:
qt-version:
description: 'Qt version to download sources for, apply patches and build'
required: true
patch-version:
description: 'Version of the patch to apply. Defaults to the one in the respository if not provided'
required: false
run-name: Qt ${{ inputs.qt-version }}
jobs:
build-qt:
name: Build Qt
runs-on: [windows-2022]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Qt Source
uses: actions/checkout@v4
with:
repository: 'qt/qt5'
ref: v${{ inputs.qt-version }}
path: 'Sources'
- name: Initialize submodules
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference=$true
Set-Location .\Sources
$repo_init_arguments = @(
"--module-subset="
@(
"default,"
"-qt3d,"
"-qt5compat,"
"-qtcharts,"
"-qtcoap,"
"-qtconnectivity,"
"-qtdatavis3d,"
"-qtdoc,"
"-qtgrpc,"
"-qthttpserver,"
"-qtlanguageserver,"
"-qtlocation,"
"-qtlottie,"
"-qtmqtt,"
"-qtnetworkauth,"
"-qtopcua,"
"-qtpositioning,"
"-qtquick3d,"
"-qtquick3dphysics,"
"-qtquickeffectmaker,"
"-qtquicktimeline,"
"-qtremoteobjects,"
"-qtscxml,"
"-qtsensors,"
"-qtspeech,"
"-qtcoap,"
"-qtconnectivity,"
"-qtdatavis3d,"
"-qtlottie,"
"-qtmqtt,"
"-qtnetworkauth,"
"-qtopcua,"
"-qtpositioning,"
"-qtquick3d,"
"-qtquicktimeline,"
"-qtremoteobjects,"
"-qtscxml,"
"-qtsensors,"
"-qtserialbus,"
"-qtserialport,"
"-qtvirtualkeyboard,"
"-qtwayland,"
"-qtwebchannel,"
"-qtwebengine,"
"-qtwebsockets,"
"-qtwebview,"
"-qtsvg,"
"-qtimageformats,"
"-qtmultimedia,"
"-qttranslations"
) -join ''
) -join ''
perl init-repository $repo_init_arguments
- name: Apply patches
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference=$true
Set-Location .\Sources
git apply ..\Patches\qt-ui-automation-id-qtbase.patch
git apply ..\Patches\qt-ui-automation-id-qtdeclarative.patch
- name: Setup Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Configure Qt Build
shell: cmd
run: |
@echo off
set "PREFIX=%CD%\Build"
echo Install Prefix: %PREFIX%
set "ARGUMENTS=-release -shared -nomake examples -nomake tests -no-feature-designer -no-feature-assistant -no-feature-linguist -schannel -direct2d -skip qtcharts,qtcoap,qtconnectivity,qtdatavis3d,qtlottie,qtmqtt,qtnetworkauth,qtopcua,qtpositioning,qtquick3d,qtquicktimeline,qtremoteobjects,qtscxml,qtsensors,qtcoap,qtconnectivity,qtdatavis3d,qtlottie,qtmqtt,qtnetworkauth,qtopcua,qtpositioning,qtquick3d,qtquicktimeline,qtremoteobjects,qtscxml,qtsensors,qtserialbus,qtserialport,qtvirtualkeyboard,qtwayland,qtwebchannel,qtwebengine,qtwebsockets,qtwebview,qtsvg,qtimageformats,qtmultimedia,qttranslations -prefix %PREFIX%"
cd Sources
echo Running: call configure %ARGUMENTS%
call configure %ARGUMENTS%
exit /b %errorlevel%
- name: Build Qt
shell: cmd
run: |
cd Sources
ninja
- name: Install Qt Build
shell: cmd
run: |
cd Sources
ninja install
- name: Stage Qt Build
uses: actions/upload-artifact@v4
with:
name: qt
path: ${{ github.workspace }}/Build/
retention-days: 2
build-test:
name: Build Test App
runs-on: [windows-2022]
needs: build-qt
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Qt Build
uses: actions/download-artifact@v4
with:
name: qt
path: ${{ github.workspace }}/Qt
- name: Setup Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Build Test app
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference=$true
Set-Location .\Test
mkdir Build
Set-Location .\Build
cmake -G "Ninja" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_PREFIX_PATH="${{ github.workspace }}\Qt" -DCMAKE_INSTALL_PREFIX="./" ..
ninja
- name: Install Test app
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference=$true
Set-Location .\Test\Build
ninja install
- name: Add Test app runtime dependencies
shell: pwsh
run: |
$PSNativeCommandUseErrorActionPreference=$true
Set-Location .\Test\Build\bin
${{ github.workspace }}\Qt\bin\windeployqt.exe --no-translations --no-compiler-runtime -release --qmldir ${{ github.workspace }}\Test .\testuiautomationid.exe
- name: Stage Test app
uses: actions/upload-artifact@v4
with:
name: testuiautomationid
path: ${{ github.workspace }}/Test/Build/bin/
retention-days: 30
test:
name: Run Test
runs-on: [windows-2022]
needs: [build-qt,build-test]
permissions:
contents: write
issues: read
checks: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Appium
shell: pwsh
run: |
npm install -g appium
appium --version
- name: Install Appium Windows Driver
shell: pwsh
run: |
appium driver install windows
- name: Download Test app
uses: actions/download-artifact@v4
with:
name: testuiautomationid
path: ${{ github.workspace }}/TestApp
- name: Run Tests
env:
UIATEST_PATH: ${{ github.workspace }}/TestApp/testuiautomationid.exe
shell: pwsh
run: |
Set-Location .\UIATest
dotnet test -c Release -v n --logger "trx;LogFileName=TestsResults.trx"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: UIATest\TestResults\*.trx
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: Patches/*
tag_name: v${{ inputs.qt-version }}