-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathappveyor.yml
399 lines (354 loc) · 17.1 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
version: 0.{build}-{branch}
# don't build tags
skip_tags: true
# exclude gh-pages branch
branches:
except:
- gh-pages
shallow_clone: true
# auto-build VSProject: OFF
build: false
#configurations to build
configuration:
- Release
# - debug
# define build matrix
environment:
global:
JOMDIR: C:\Qt\Tools\QtCreator\bin
VSVER: 0
CMAKE_BUILDFLAGS:
USE_CMAKE: true
INSTALL_QMAKE5: false
BUILD_CONFIG: Debug
USE_CXX20: OFF
matrix:
- NAME: "Ubuntu2004: CMake, Qt6"
QTABI: gcc_64
COMPILER: GCC
QTVER: 6.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
CMAKE_GENERATOR: "Unix Makefiles"
INSTALL_QMAKE5: true
TEST_FETCHCONTENT: false
- NAME: "Ubuntu2004: CMake, Qt6, C++20"
QTABI: gcc_64
COMPILER: GCC
QTVER: 6.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
CMAKE_GENERATOR: "Unix Makefiles"
INSTALL_QMAKE5: true
TEST_FETCHCONTENT: false
USE_CXX20: ON
- NAME: "Ubuntu2004: CMake-FetchContent, Qt6"
QTABI: gcc_64
COMPILER: GCC
QTVER: 6.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
CMAKE_GENERATOR: "Unix Makefiles"
TEST_FETCHCONTENT: true
- NAME: "Ubuntu2004: CMake, Qt5"
QTABI: gcc_64
COMPILER: GCC
QTVER: 5.15
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
CMAKE_GENERATOR: "Unix Makefiles"
INSTALL_QMAKE5: true
TEST_FETCHCONTENT: false
- NAME: "Ubuntu2004: QMake, Qt6"
QTABI: gcc_64
COMPILER: GCC
QTVER: 5.15
USE_CMAKE: false
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
CMAKE_GENERATOR: "Unix Makefiles"
INSTALL_QMAKE5: true
TEST_FETCHCONTENT: false
- NAME: "MSVC64: CMake, Qt5"
QTABI: msvc2019_64
COMPILER: MSVC
QTVER: 5.15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_BUILDFLAGS: /verbosity:minimal /maxcpucount
TEST_FETCHCONTENT: false
- NAME: "MSVC64: CMake, Qt6"
QTABI: msvc2019_64
COMPILER: MSVC
QTVER: 6.5
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_BUILDFLAGS: /verbosity:minimal /maxcpucount
TEST_FETCHCONTENT: false
- NAME: "MacOS: CMake, Qt6"
QTABI: macos
COMPILER: CLANG
QTVER: 6.6
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
CMAKE_GENERATOR: "Unix Makefiles"
TEST_FETCHCONTENT: false
for:
# Windows (MinGW 8.1 & MSVC2019)
-
matrix:
only:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
init:
- cmd: echo == INIT SYSTEM ENVIRONMENT ======================================================================
- cmd: echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS%
- cmd: echo PROCESSOR_IDENTIFIER=%PROCESSOR_IDENTIFIER%
- cmd: echo APPVEYOR_BUILD_WORKER_IMAGE=%APPVEYOR_BUILD_WORKER_IMAGE%
- cmd: echo QTABI=%QTABI%
- cmd: echo CMAKE_GENERATOR=%CMAKE_GENERATOR%
- cmd: echo CMAKE_BUILDFLAGS=%CMAKE_BUILDFLAGS%
install:
# Init compiler environment
- cmd: echo == INIT COMPILER ENVIRONMENT ====================================================================
- cmd: set QTDIR=C:\Qt\%QTVER%\%QTABI%\bin
- cmd: set QT_DIR=C:\Qt\%QTVER%\%QTABI%\bin
- cmd: set PATH=%QTDIR%;%JOMDIR%;%PATH%
- cmd: if %COMPILER%==MinGW set "PATH=%MINGWDIR%\bin;%PATH%"
- cmd: if %QTABI%==msvc2019 call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
- cmd: if %QTABI%==msvc2019_64 call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
# Rename sh.exe as sh.exe in PATH interferes with MinGW
- cmd: if %COMPILER%==MinGW rename "C:\Program Files\Git\usr\bin\sh.exe" "sh2.exe"
- cmd: echo QTDIR=%QTDIR%
- cmd: echo QT_DIR=%QT_DIR%
- cmd: echo JOMDIR=%JOMDIR%
- cmd: echo PATH=%PATH%
# Install OpenCV
- cmd: echo == INSTALL OPENCV ===============================================================================
- cmd: choco install OpenCV
- cmd: set OPENCV_DIR=C:\tools\opencv\build
- cmd: echo OPENCV_DIR=%OPENCV_DIR%
# Install CImg
- cmd: echo == INSTALL CIMG =================================================================================
- cmd: mkdir C:\tools\cimg
- cmd: git clone --depth=1 https://github.com/dtschump/CImg.git C:\tools\cimg
- cmd: set CIMG_DIR=C:\tools\cimg
- cmd: echo CIMG_DIR=%CIMG_DIR%
- cmd: set CIMG_INCLUDE_DIR=C:\tools\cimg
- cmd: echo CIMG_INCLUDE_DIR=%CIMG_INCLUDE_DIR%
build_script:
- cmd: echo == BUILD JKQtPlotter ============================================================================
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: mkdir build
- cmd: mkdir install
- cmd: cd build
- cmd: if %USE_CMAKE%==true cmake --version
- cmd: if %USE_CMAKE%==true cmake -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QTDIR%;%CIMG_INCLUDE_DIR%" "-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%\install" "-DJKQtPlotter_ENABLED_CXX20=$USE_CXX20" ..
- cmd: if %USE_CMAKE%==true cmake --build . --config "%BUILD_CONFIG%" -j%NUMBER_OF_PROCESSORS% -- %CMAKE_BUILDFLAGS%
- cmd: if %USE_CMAKE%==false qmake.exe -v
- cmd: if %USE_CMAKE%==false qmake.exe CONFIG+=%BUILD_CONFIG% ..\JKQtPlotterBuildAllExamples.pro
- cmd: if %USE_CMAKE%==false call %MAKETOOL%
- cmd: cd ..
- cmd: echo == INSTALL JKQtPlotter ==========================================================================
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: cd build
- cmd: if %USE_CMAKE%==true cmake --install . --config "%BUILD_CONFIG%"
after_build:
- cmd: echo == TEST USE JKQtPlotter CMAKE BUILD ============================================================
- cmd: cd %APPVEYOR_BUILD_FOLDER%
- cmd: if %USE_CMAKE%==true cd examples
- cmd: if %USE_CMAKE%==true cd cmake_link_example
- cmd: if %USE_CMAKE%==true mkdir build
- cmd: if %USE_CMAKE%==true cd build
- cmd: if %USE_CMAKE%==true cmake -G "%CMAKE_GENERATOR%" "-DCMAKE_PREFIX_PATH=%QTDIR%;%CIMG_INCLUDE_DIR%;%APPVEYOR_BUILD_FOLDER%\install" ..
- cmd: if %USE_CMAKE%==true cmake --build . --config "%BUILD_CONFIG%" -j%NUMBER_OF_PROCESSORS% -- %CMAKE_BUILDFLAGS%
- cmd: cd ..
test_script:
- cmd: if %USE_CMAKE%==true echo == RUNNING UNIT TESTS FOR JKQtPlotter CMAKE BUILD ===============================================
- cmd: if %USE_CMAKE%==true cd %APPVEYOR_BUILD_FOLDER%
- cmd: if %USE_CMAKE%==true cd build
- cmd: if %USE_CMAKE%==true ctest --version
- cmd: if %USE_CMAKE%==true ctest --print-labels --build-config "%BUILD_CONFIG%"
- cmd: if %USE_CMAKE%==true ctest --build-config "%BUILD_CONFIG%" -VV --output-on-failure --output-junit %APPVEYOR_BUILD_FOLDER%\build\test-results.xml
after_test:
- ps: |
If (Test-Path %APPVEYOR_BUILD_FOLDER%\build\test-results.xml) {
(new-object net.webclient).UploadFile(
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
(Resolve-Path %APPVEYOR_BUILD_FOLDER%\build\test-results.xml)
)
}
$LastExitCode = 0
# Linux (Ubuntu2004)
-
matrix:
only:
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
init:
- sh: echo == INIT SYSTEM ENVIRONMENT ======================================================================
- sh: echo _NPROCESSORS_ONLN=$(getconf _NPROCESSORS_ONLN)
- sh: echo APPVEYOR_BUILD_WORKER_IMAGE=$APPVEYOR_BUILD_WORKER_IMAGE
- sh: echo QTABI=$QTABI
- sh: echo CMAKE_GENERATOR=$CMAKE_GENERATOR
- sh: cmake --version
install:
# Init compiler environment
- sh: echo == INIT COMPILER ENVIRONMENT ====================================================================
- sh: export QTDIR=$HOME/Qt/$QTVER/$QTABI/
- sh: export QT_DIR=$HOME/Qt/$QTVER/$QTABI/
- sh: export Qt5_DIR=$QTDIR/lib/cmake
- sh: sudo ls /etc/apt/sources.list.d/
#- sh: sudo rm /etc/apt/sources.list.d/github_git-lfs.list
- sh: sudo apt update -yy --allow-releaseinfo-change
- sh: if [ "$INSTALL_QMAKE5" = true ]; then sudo apt install -y build-essential git mesa-common-dev libglu1-mesa-dev qt5-qmake ; fi
- sh: if [ "$INSTALL_QMAKE5" = false ]; then sudo apt install -y build-essential git mesa-common-dev libglu1-mesa-dev ; fi
- sh: echo QTDIR=$QTDIR
- sh: echo QT_DIR=$QT_DIR
- sh: echo Qt5_DIR=$Qt5_DIR
- sh: echo PATH=$PATH
# Install OpenCV
- sh: |
if [ "$USE_CMAKE" = true ]; then
echo == INSTALL OPENCV ===============================================================================
sudo apt install -y libopencv-dev
fi
# Install CImg
- sh: |
if [ "$USE_CMAKE" = true ]; then
echo == INSTALL CIMG =================================================================================
mkdir $HOME/cimg
git clone --depth=1 https://github.com/dtschump/CImg.git $HOME/cimg
ls $HOME/*
ls $HOME/cimg/*
export CIMG_DIR=$HOME/cimg
echo "CIMG_DIR=$CIMG_DIR"
export CIMG_INCLUDE_DIR=$HOME/cimg
echo "CIMG_INCLUDE_DIR=$CIMG_INCLUDE_DIR"
fi
build_script:
- sh: echo == BUILD JKQtPlotter ============================================================================
- sh: cd $APPVEYOR_BUILD_FOLDER
- sh: mkdir build
- sh: mkdir install
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
cd build
echo --- Run CMake Configure -----------------------------------------------------------------------------
cmake --version
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_PREFIX_PATH=$QTDIR;$CIMG_INCLUDE_DIR" "-DCMAKE_INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/install" "-DCMAKE_BUILD_TYPE=$BUILD_CONFIG" "-DJKQtPlotter_ENABLED_CXX20=$USE_CXX20" ..
echo --- Build using CMake -------------------------------------------------------------------------------
cmake --build . --config "$BUILD_CONFIG" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
fi
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = true ]; then
cd examples/cmake_fetchcontent_example
mkdir build
cd build
echo --- Run CMake Configure with FetchCOntent -----------------------------------------------------------
cmake --version
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_PREFIX_PATH=$QTDIR;$CIMG_INCLUDE_DIR" "-DCMAKE_BUILD_TYPE=$BUILD_CONFIG" "-DCMAKE_INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/install" "-DJKQtPlotter_ENABLED_CXX20=$USE_CXX20" ..
echo --- Build using CMake with FetchCOntent -------------------------------------------------------------
cmake --build . --config "$BUILD_CONFIG" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
fi
- sh: |
if [ "$USE_CMAKE" = false ]; then
cd build
echo --- Run QMake Configure -----------------------------------------------------------------------------
$QTDIR/bin/qmake -v
$QTDIR/bin/qmake -makefile -o Makefile "CONFIG+=$BUILD_CONFIG" ../JKQtPlotterAppveyorBuild.pro
echo --- Build for QMake ---------------------------------------------------------------------------------
make -j$(getconf _NPROCESSORS_ONLN)
fi
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
echo == INSTALL JKQtPlotter ==========================================================================
cd $APPVEYOR_BUILD_FOLDER
cd build
echo --- Install using CMake -------------------------------------------------------------------------------
cmake --install . --config "$BUILD_CONFIG"
fi
after_build:
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
echo == TEST USE JKQtPlotter CMAKE BUILD ============================================================
cd $APPVEYOR_BUILD_FOLDER
cd examples/cmake_link_example
mkdir build
cd build
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_CONFIG" "-DCMAKE_PREFIX_PATH=$QTDIR;$CIMG_INCLUDE_DIR;$APPVEYOR_BUILD_FOLDER/install" ..
cmake --build . --config "$BUILD_CONFIG" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
cd ..
fi
test_script:
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
echo == RUNNING UNIT TESTS FOR JKQtPlotter CMAKE BUILD ===============================================
cd $APPVEYOR_BUILD_FOLDER
cd build
ctest --version
ctest --print-labels --build-config "$BUILD_CONFIG"
ctest --build-config "$BUILD_CONFIG" -VV --output-on-failure --output-junit test-results.xml
fi
after_test:
- find "$APPVEYOR_BUILD_FOLDER" -type f -name 'test-results.xml' -print0 | xargs -0 -I '{}' curl -F 'file=@{}' "https://ci.appveyor.com/api/testresults/junit/$APPVEYOR_JOB_ID"
# MacOS (Monterey)
-
matrix:
only:
- APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
init:
- sh: echo == INIT SYSTEM ENVIRONMENT ======================================================================
- sh: echo _NPROCESSORS_ONLN=$(getconf _NPROCESSORS_ONLN)
- sh: echo APPVEYOR_BUILD_WORKER_IMAGE=$APPVEYOR_BUILD_WORKER_IMAGE
- sh: echo QTABI=$QTABI
- sh: echo CMAKE_GENERATOR=$CMAKE_GENERATOR
install:
# Init compiler environment
- sh: echo == INIT COMPILER ENVIRONMENT ====================================================================
- sh: export QTDIR=$HOME/Qt/$QTVER/$QTABI/
- sh: export QT_DIR=$HOME/Qt/$QTVER/$QTABI/
- sh: export Qt5_DIR=$QTDIR/lib/cmake
- sh: echo QTDIR=$QTDIR
- sh: echo QT_DIR=$QT_DIR
- sh: echo Qt5_DIR=$Qt5_DIR
- sh: echo PATH=$PATH
# Install OpenCV
build_script:
- sh: echo == BUILD JKQtPlotter ============================================================================
- sh: mkdir build
- sh: cd build
- sh: echo --- Run CMake Configure -----------------------------------------------------------------------------
- sh: cmake --version
- sh: cmake -G "$CMAKE_GENERATOR" "-DCMAKE_PREFIX_PATH=$QTDIR" "-DCMAKE_BUILD_TYPE=$BUILD_CONFIG" "-DJKQtPlotter_ENABLED_CXX20=$USE_CXX20" "-DCMAKE_INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/install" .. ..
- sh: echo --- Build using CMake -------------------------------------------------------------------------------
- sh: cmake --build . --config "$BUILD_CONFIG" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
echo == INSTALL JKQtPlotter ==========================================================================
cd $APPVEYOR_BUILD_FOLDER
cd build
echo --- Install using CMake -------------------------------------------------------------------------------
cmake --install . --config "$BUILD_CONFIG"
fi
after_build:
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
echo == TEST USE JKQtPlotter CMAKE BUILD ============================================================
cd $APPVEYOR_BUILD_FOLDER
cd examples/cmake_link_example
mkdir build
cd build
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_CONFIG" "-DCMAKE_PREFIX_PATH=$QTDIR;$CIMG_INCLUDE_DIR;$APPVEYOR_BUILD_FOLDER/install" ..
cmake --build . --config "$BUILD_CONFIG" -j$(getconf _NPROCESSORS_ONLN) -- $CMAKE_BUILDFLAGS
cd ..
fi
test_script:
- sh: |
if [ "$USE_CMAKE" = true ] && [ "$TEST_FETCHCONTENT" = false ]; then
echo == RUNNING UNIT TESTS FOR JKQtPlotter CMAKE BUILD ===============================================
cd $APPVEYOR_BUILD_FOLDER
cd build
ctest --version
ctest --print-labels --build-config "$BUILD_CONFIG"
ctest --build-config "$BUILD_CONFIG" -VV --output-on-failure --output-junit test-results.xml
fi
after_test:
- find "$APPVEYOR_BUILD_FOLDER" -type f -name 'test-results.xml' -print0 | xargs -0 -I '{}' curl -F 'file=@{}' "https://ci.appveyor.com/api/testresults/junit/$APPVEYOR_JOB_ID"
#artifacts:
# - path: 'install'
# name: install-results
# type: zip
# - path: 'build/**/test-results.xml'
# name: test_results