forked from trikset/trik-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
272 lines (247 loc) · 11.5 KB
/
appveyor.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
#version: 999.{branch}-{build}
clone_folder: c:\studio
#test: off
clone_depth: 1
#shallow_clone: true
skip_commits:
files:
- '**/lsan.supp'
- 'buildScripts/travis/*'
- 'buildScripts/azure/*'
- 'buildScripts/docker/*'
- 'azure-pipelines.yml'
- '.cirrus.yml'
- '.travis.yml'
- '.mergify.yml'
- '.github/*'
- 'Brewfile'
- '**/*.html'
- '**/*.txt'
- '**/*.md'
- 'installer/packages/**/meta/prebuild-mac.sh'
- 'installer/packages/**/meta/prebuild-linux-gnu.sh'
- '**/*.dockerfile'
- '**/*.Dockerfile'
- '**/Dockerfile'
- '**/Dockerfile.*'
- 'plugins/robots/checker/scripts/build-checker-installer.sh'
message: /\[NOCI\]/
branches:
except:
- /dependabot.*/
environment:
global:
PYTHON_VERSION_MINOR: 8 # Default to Python 3.8
MSYS_DIR: C:\msys64
APPVEYOR_SAVE_CACHE_ON_ERROR: true
CCACHE_DIR: C:\ccache.cache
BUILD_DIR: '%APPVEYOR_BUILD_FOLDER%\.build'
PROJECT_FILE: studio
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
master_ci:
secure: CuoEe+MMcU6PLsinM6SbBsq2QWGiTmpTH/kPfC20g7M=
server:
secure: cSPfeMLOOlPhHRS4eZz337/2X+HUquhXmDZx2OgRSFE=
password:
secure: e2Rwbvcr6Z/YAX4N0/tO3w==
matrix:
- QT: 5.12
ARCH: 32
CONFIGURATION: release
QTIFW: C:\Qt\Tools\QtInstallerFramework\3.1
# - QT: 5.12
# ARCH: 64
# CONFIGURATION: release
# QTIFW: C:\Qt\Tools\QtInstallerFramework\3.1
# - QT: 5.12
# ARCH: 32
# PYTHON_VERSION_MINOR: 8
# CONFIGURATION: release
# QTIFW: C:\Qt\Tools\QtInstallerFramework\3.1
# Qt5.14 build takes too long (2x times) and reaches timeout
# - QT: 5.14
# ARCH: 32
# PYTHON_VERSION_MINOR: 8
# CONFIGURATION: release
# QTIFW: C:\Qt\Tools\QtInstallerFramework\3.2
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
matrix:
allow_failures:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
#cache:
# - '%BUILD_DIR% -> **\*.pr?, appveyor.yml'
# - '%CCACHE_DIR% -> **\*.pr?, appveyor.yml'
# - C:\ProgramData\chocolatey\bin -> appveyor.yml
# - C:\ProgramData\chocolatey\lib -> appveyor.yml
# - '%MSYS_DIR%\var\cache\pacman\pkg -> appveyor.yml'
#for:
# -
# matrix:
# only:
# - QT: 5.14
# image: Visual Studio 2019
init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- set PYTHON_PATH=C:\Python3%PYTHON_VERSION_MINOR%
- if "%ARCH%" == "64" (set PYTHON_PATH=%PYTHON_PATH%-x64)
- set PYTHON_LIB=%PYTHON_PATH%\libs
- set QTDIR=C:\Qt\%QT%\mingw73_%ARCH%
- set MINGW=C:\Qt\Tools\mingw730_%ARCH%
- 'dir %PYTHON_PATH% %MINGW% %QTDIR% %QTIFW% %MSYS_DIR% /w'
- set PATH
- set PATH=%APPVEYOR_BUILD_FOLDER%\buildScripts\appveyor;%QTDIR%\bin;%MINGW%\bin;C:\msys64\mingw%ARCH%\bin;C:\msys64\usr\bin;%SystemRoot%;%SystemRoot%\system32;C:\Program Files\7-Zip;%SystemRoot%\system32\WindowsPowerShell\v1.0;C:\Tools\curl\bin;C:\Program Files\AppVeyor\BuildAgent\
- set PATH
- if "x%appveyor_pull_request_number%" NEQ "x" set APPVEYOR_CACHE_SKIP_SAVE=true
- if "x%appveyor_repo_branch%" NEQ "xmaster" set APPVEYOR_CACHE_SKIP_SAVE=true
- if "%ARCH%" == "32" (set PLATFORM=i686) else (set PLATFORM=x86_64)
- set NEED_AUTOZIP=false
- set NEED_BINZIP=false
- set NEED_INSTALLER=false
#TODO: multiline %APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED% can cause problems
- 'set "FULL_MESSAGE=%APPVEYOR_PULL_REQUEST_TITLE% %APPVEYOR_REPO_COMMIT_MESSAGE%"'
- 'echo #%FULL_MESSAGE%#'
- 'if "%FULL_MESSAGE:[INSTALLER]=%" NEQ "%FULL_MESSAGE%" ( set "NEED_INSTALLER=true" )'
- 'if "%FULL_MESSAGE:[BINZIP]=%" NEQ "%FULL_MESSAGE%" ( set "NEED_BINZIP=true" )'
- 'if "%FULL_MESSAGE:[AUTOZIP]=%" NEQ "%FULL_MESSAGE%" ( set "NEED_AUTOZIP=true" )'
# this is a push/merge for branch (else it is a PR)
- if "x%appveyor_pull_request_number%" EQU "x" (set "NEED_AUTOZIP=true")
#this is a tagged commit build
- if "%APPVEYOR_REPO_TAG%" EQU "true" ( set "NEED_INSTALLER=true" && set "NEED_AUTOZIP=true" )
#disable artifacts for non-default Python builds
- if "%PYTHON_VERSION_MINOR%" NEQ "8" ( set "NEED_INSTALLER=false" && set "NEED_AUTOZIP=false" )
- 'echo "Deploy installer executable: %NEED_INSTALLER%"'
- 'echo "Deploy \\bin zip archive: %NEED_BINZIP%"'
- 'echo "Deploy full zipped installer: %NEED_AUTOZIP%"'
# deal with 2020 summer package upgrade problem, when keys changed
- curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
- curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig
- pacman --noconfirm -U msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz || bash -lc 'pacman --noconfirm -U --config <(echo) msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz'
# Deal with December 2020 MSYS2 update: update core files to migrate to zstd compression
- curl -O http://repo.msys2.org/msys/x86_64/zstd-1.4.7-1-x86_64.pkg.tar.xz # the latest in xz
- curl -O http://repo.msys2.org/msys/x86_64/pacman-5.2.2-5-x86_64.pkg.tar.xz # the latest in xz
- pacman --verbose --noconfirm --disable-download-timeout -U zstd-1.4.7-1-x86_64.pkg.tar.xz pacman-5.2.2-5-x86_64.pkg.tar.xz # Upgrade now (Dec 2020) needs zstd decompressor
- 'del /q %APPVEYOR_BUILD_FOLDER%\*.*' # cleanup before checkout
- cmd /c "pacman --verbose --noconfirm --disable-download-timeout -Syuu" #Full update of core files
- cmd /c "pacman --verbose --noconfirm --disable-download-timeout -Sy" #Update core files if databases list was changed
clone_script:
- cmd: |
"C:\\Program Files\\Git\\cmd\\git" config --global core.symlinks true
"C:\\Program Files\\Git\\cmd\\git" config --global core.autocrlf true
"C:\\Program Files\\Git\\cmd\\git" clone --progress --single-branch --no-checkout --branch=%appveyor_repo_branch% https://github.com/%appveyor_repo_name%.git %appveyor_build_folder%
cd %appveyor_build_folder%
if "x%appveyor_pull_request_number%" == "x" ( "C:\\Program Files\\Git\\cmd\\git" checkout -f %appveyor_repo_commit% ) else ( "C:\\Program Files\\Git\\cmd\\git" fetch origin +refs/pull/%appveyor_pull_request_number%/merge: && "C:\\Program Files\\Git\\cmd\\git" checkout -f FETCH_HEAD )
"C:\\Program Files\\Git\\cmd\\git" submodule update --init --recursive
install:
- 'qmake -v && qmake -query'
- 'dir %PYTHON_PATH% %MINGW% %QTDIR% %QTIFW% %MSYS_DIR% /w'
- curl --output tests.7z "https://dl.trikset.com/edu/.solutions20200701/testing_small.7z"
- cmd /c "pacman --verbose --noconfirm -S dos2unix ccache rsync unzip sshpass mingw%ARCH%/mingw-w64-%PLATFORM%-libusb mingw%ARCH%/mingw-w64-%PLATFORM%-zlib mingw%ARCH%/mingw-w64-%PLATFORM%-pkg-config"
- 7z x tests.7z
- dir /w testing_small
- ccache.exe -V || appveyor DownloadFile "http://alam.srb2.org/ccache.exe" -FileName "ccache.exe" && xcopy /Y /V /I ccache.exe %MINGW%\bin && ccache -V
- ccache -p || echo "Failed to print ccache config (missing -p option)"
- if not exist %BUILD_DIR% mkdir %BUILD_DIR%
# - du -sh %BUILD_DIR% %CCACHE_DIR%
- ccache -M 900M
- which g++
- g++ --version
- ls
- dir C:\Qt\Tools\
- dir C:\Qt
# before_build:
# - curl https://raw.githubusercontent.com/MestreLion/git-tools/master/git-restore-mtime-bare > .fix-mtime.py
# - python "%PYTHON_PATH%\Tools\scripts\2to3.py" -v -p -w -n -f all .fix-mtime.py
# - sed -ri "s#line.(startswith|split)\(#line.\1\(b#g" .fix-mtime.py
# - python .fix-mtime.py
# - git submodule foreach --recursive python %cd%\.fix-mtime.py
build_script:
- cd %BUILD_DIR%
- bash -c "env LC_ALL=C date -u"
- 'git status -vv && git submodule foreach --recursive git status'
- qmake %APPVEYOR_BUILD_FOLDER%\%PROJECT_FILE%.pro -spec win32-g++ CONFIG+=%CONFIGURATION% CONFIG+=tests CONFIG+=silent # QMAKE_CXX="ccache g++"
- bash -c "env LC_ALL=C date -u"
- mingw32-make qmake_all
- bash -c "env LC_ALL=C date -u"
- mingw32-make -k check
test_script:
- echo %cd%
- cd %BUILD_DIR%\bin\%CONFIGURATION%
- dir
- for %%f in (*.exe) do windeployqt --%CONFIGURATION% %%f
- set PYTHONIOENCODING=utf-8 & python "%APPVEYOR_BUILD_FOLDER%\buildScripts\tests\fieldstest.py" 2D-model.exe %APPVEYOR_BUILD_FOLDER%\testing_small
after_test:
# zip binaries
- cd %BUILD_DIR%/bin/%CONFIGURATION%
- bash -c "env LC_ALL=C date -u"
- for %%f in (*.exe) do windeployqt --%CONFIGURATION% %%f
- xcopy /I /Y %QTDIR%\plugins\platforms %BUILD_DIR%\bin\%CONFIGURATION%\platforms
- set ZIP_NAME=trik-studio
- set APPVEYOR_REPO_BRANCH_SAFE=%APPVEYOR_REPO_BRANCH:/=-%
- if %APPVEYOR_REPO_TAG%==true (set ZIP_NAME=%ZIP_NAME%_%APPVEYOR_REPO_TAG_NAME%) else (set ZIP_NAME=%ZIP_NAME%-%APPVEYOR_REPO_BRANCH_SAFE%)
- set ZIP_NAME=%ZIP_NAME%_qt%QT%_%PLATFORM%_%CONFIGURATION%.zip
- bash -c "env LC_ALL=C date -u"
- echo "ZipName:%ZIP_NAME%"
- cd %BUILD_DIR%/bin/%CONFIGURATION%
- 7z a -- %APPVEYOR_BUILD_FOLDER%\%ZIP_NAME% .
- cd %APPVEYOR_BUILD_FOLDER%
- if "%NEED_BINZIP%" EQU "true" (appveyor PushArtifact %ZIP_NAME%)
- if "%CONFIGURATION%" NEQ "release" ( exit /b 0 )
# build installer
- cd %APPVEYOR_BUILD_FOLDER%/installer
- bash -c "env LC_ALL=C date -u"
- 'bash -c "./build-trik-studio.sh %QTDIR:\=/% %QTIFW:\=/%/bin %BUILD_DIR:\=/%"'
- set INSTALLER_NAME=trik-studio
- if %APPVEYOR_REPO_TAG%==true (set INSTALLER_NAME=%INSTALLER_NAME%_%APPVEYOR_REPO_TAG_NAME%) else (set INSTALLER_NAME=%INSTALLER_NAME%-%APPVEYOR_REPO_BRANCH_SAFE%)
- if "%PYTHON_VERSION_MINOR%" NEQ "8" (set INSTALLER_NAME=%INSTALLER_NAME%-Python3%PYTHON_VERSION_MINOR%)
- set INSTALLER_NAME=%INSTALLER_NAME%-%PLATFORM%
- set AUTOINSTALLER_ZIP_NAME=%INSTALLER_NAME%-auto.zip
- set INSTALLER_NAME=%INSTALLER_NAME%-installer.exe
- echo "Installer:%INSTALLER_NAME%"
- ren trik-studio*installer*.exe %INSTALLER_NAME%
- cd %APPVEYOR_BUILD_FOLDER%
- if "%NEED_INSTALLER%" EQU "true" (appveyor PushArtifact installer\%INSTALLER_NAME%)
# pack autoinstaller
- bash -c "env LC_ALL=C date -u"
- cd %APPVEYOR_BUILD_FOLDER%/installer
- 7z a -- %AUTOINSTALLER_ZIP_NAME% %INSTALLER_NAME% trik_studio*.qs reinstall*
- cd %APPVEYOR_BUILD_FOLDER%
- if "%NEED_AUTOZIP%" EQU "true" (appveyor PushArtifact installer\%AUTOINSTALLER_ZIP_NAME%)
# install
- cd %APPVEYOR_BUILD_FOLDER%\installer
- bash -c "env LC_ALL=C date -u"
- cmd /c %INSTALLER_NAME% --script trik_studio_installscript.qs
- dir C:\TRIKStudio
- bash -c "env LC_ALL=C date -u"
# deployment
#- ps: if ( $artifacts.Count -eq 0 ) { exit 1 }
- IF "x%server%" NEQ "x" (sshpass -p %password% rsync -avze 'ssh -o StrictHostKeyChecking=no' %INSTALLER_NAME% %server%:dl/ts/fresh/installer/)
before_deploy:
- ps: if ( $artifacts.Count -eq 0 ) { exit 1 }
deploy:
- provider: Environment
name: trik-studio-fresh
on:
ARCH: 32
APPVEYOR_PROJECT_SLUG: $(master_ci)
- provider: Environment
name: trik-studio-64
on:
ARCH: 64
APPVEYOR_PROJECT_SLUG: $(master_ci)
- provider: Environment
name: github-release
github_release_artifact: $(AUTOINSTALLER_ZIP_NAME)
on:
ARCH: 32
QT: 5.12
CONFIGURATION: release
APPVEYOR_REPO_TAG: true
APPVEYOR_PROJECT_SLUG: $(master_ci)
on_finish:
- ccache -s
- bash -c "env LC_ALL=C date -u"
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
notifications:
- provider: GitHubPullRequest
on_build_failure: false
template: "{{#passed}}Download:\n{{#jobs}}{{name}}\n{{#artifacts}} [{{fileName}}]({{permalink}}) \n {{/artifacts}}{{/jobs}}{{/passed}}"