1
1
.test :
2
- # The image was generated with the following Dockerfile. It is also used
3
- # for libxslt, that's why we need git and libgcrypt-dev.
4
- #
5
- # FROM ubuntu:20.04
6
- # ENV DEBIAN_FRONTEND=noninteractive
7
- # RUN apt-get update && \
8
- # apt-get upgrade -y && \
9
- # apt-get install -y --no-install-recommends \
10
- # curl git ca-certificates \
11
- # autoconf automake libtool pkg-config \
12
- # make gcc clang llvm \
13
- # zlib1g-dev liblzma-dev libgcrypt-dev \
14
- # python-dev python3-dev \
15
- # cmake
16
- # WORKDIR /tests
17
- # RUN curl https://www.w3.org/XML/Test/xmlts20080827.tar.gz |tar xz
18
2
image : registry.gitlab.gnome.org/gnome/libxml2
19
3
variables :
20
4
BASE_CONFIG : " --with-ftp --with-legacy --with-xptr-locs"
5
+ before_script :
6
+ - rm -rf libxml2-build
7
+ - mkdir libxml2-build
8
+ - ln -s /tests/xmlconf libxml2-build
21
9
script :
22
- - |
23
- rm -rf build
24
- mkdir build
25
- cd build
26
- ln -s /tests/xmlconf
27
- sh ../autogen.sh $BASE_CONFIG $CONFIG
28
- make -j$(nproc) V=1
29
- make check
10
+ - sh .gitlab-ci/test.sh
30
11
31
12
gcc :
32
13
extends : .test
@@ -42,60 +23,92 @@ gcc:minimum:
42
23
gcc:python3 :
43
24
extends : .test
44
25
variables :
45
- # TODO: Re-enable the warning after #208 is fixed.
46
- CFLAGS : " -O2 -Wno-error=deprecated-declarations"
26
+ CFLAGS : " -O2"
47
27
PYTHON : " /usr/bin/python3"
48
28
49
29
gcc:static :
50
30
extends : .test
51
31
variables :
52
- CONFIG : " --disable-shared --without-python"
32
+ CONFIG : " --disable-shared --without-python --without-modules "
53
33
CFLAGS : " -O2"
54
34
55
35
clang:asan :
56
36
extends : .test
37
+ tags :
38
+ - asan
57
39
variables :
58
40
CONFIG : " --without-python"
59
41
CC : clang
60
- CFLAGS : " -O2 -g -fno-omit-frame-pointer -fsanitize=address,undefined,unsigned-integer-overflow,implicit-conversion -fno-sanitize-recover=all -Wno-error=cast-align"
61
- # LeakSanitizer requires SYS_CAP_PTRACE
62
- ASAN_OPTIONS : " detect_leaks=0"
42
+ CFLAGS : " -O2 -g -fno-omit-frame-pointer -fsanitize=address,undefined,integer -fno-sanitize-recover=all -Wno-error=cast-align"
63
43
UBSAN_OPTIONS : " print_stacktrace=1"
44
+ ASAN_SYMBOLIZER_PATH : " $CI_PROJECT_DIR/.gitlab-ci/llvm-symbolizer"
64
45
65
46
clang:msan :
66
47
extends : .test
67
- only :
68
- - schedules
48
+ # only:
49
+ # - schedules
69
50
variables :
70
51
CONFIG : " --without-python --without-zlib --without-lzma"
71
52
CC : clang
72
53
CFLAGS : " -O2 -g -fno-omit-frame-pointer -fsanitize=memory -Wno-error=cast-align"
54
+ MSAN_SYMBOLIZER_PATH : " $CI_PROJECT_DIR/.gitlab-ci/llvm-symbolizer"
55
+
56
+ .mingw :
57
+ tags :
58
+ - win32-ps
59
+ variables :
60
+ BASE_CONFIG : " --with-ftp --with-legacy --with-xptr-locs"
61
+ CHERE_INVOKING : " yes"
62
+ before_script :
63
+ - $Env:Path="C:\msys64\usr\bin;$Env:Path"
64
+ - bash -lc 'sh .gitlab-ci/setup_mingw.sh autotools'
65
+ script :
66
+ - bash -lc 'sh .gitlab-ci/test.sh'
67
+ cache :
68
+ key : " $MSYSTEM"
69
+ paths :
70
+ - libxml2-build/xmlconf/
71
+
72
+ mingw:w64-x86_64:shared :
73
+ extends : .mingw
74
+ variables :
75
+ CFLAGS : " -O2"
76
+ MSYSTEM : MINGW64
77
+
78
+ mingw:w64-i686:shared :
79
+ extends : .mingw
80
+ only :
81
+ - schedules
82
+ variables :
83
+ CFLAGS : " -O2"
84
+ MSYSTEM : MINGW32
85
+
86
+ # Disabled, GCC missing?
87
+ .mingw:msys:shared :
88
+ extends : .mingw
89
+ variables :
90
+ CFLAGS : " -O2"
91
+ MSYSTEM : MSYS
73
92
74
93
.cmake:linux :
75
94
image : registry.gitlab.gnome.org/gnome/libxml2
95
+ before_script :
96
+ - rm -rf libxml2-build
97
+ - mkdir libxml2-build
98
+ - ln -s /tests/xmlconf libxml2-build
76
99
script :
77
- - cmake -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBXML2_XMLCONF_WORKING_DIR=/tests -S . -B libxml2-build
78
- - cmake --build libxml2-build --target install
79
- - mkdir -p libxml2-install/share/libxml2
80
- - cp Copyright libxml2-install/share/libxml2
81
- - cd libxml2-build
82
- - ctest -VV
83
- after_script :
84
- - cd libxml2-install
85
- - tar -czf ../libxml2-$CI_COMMIT_SHORT_SHA-$CC-$SUFFIX.tar.gz *
100
+ - sh .gitlab-ci/test_cmake.sh
86
101
artifacts :
87
102
paths :
88
- - libxml2-$CI_COMMIT_SHORT_SHA-$CC-$ SUFFIX.tar.gz
103
+ - libxml2-$CI_COMMIT_SHORT_SHA-$SUFFIX.tar.gz
89
104
expire_in : 1 day
90
105
91
106
cmake:linux:gcc:shared :
92
107
extends : .cmake:linux
93
- only :
94
- - schedules
95
108
variables :
96
109
BUILD_SHARED_LIBS : " ON"
97
110
CC : gcc
98
- SUFFIX : shared
111
+ SUFFIX : linux-gcc- shared
99
112
100
113
cmake:linux:gcc:static :
101
114
extends : .cmake:linux
@@ -104,7 +117,7 @@ cmake:linux:gcc:static:
104
117
variables :
105
118
BUILD_SHARED_LIBS : " OFF"
106
119
CC : gcc
107
- SUFFIX : static
120
+ SUFFIX : linux-gcc- static
108
121
109
122
cmake:linux:clang:shared :
110
123
extends : .cmake:linux
@@ -113,7 +126,8 @@ cmake:linux:clang:shared:
113
126
variables :
114
127
BUILD_SHARED_LIBS : " ON"
115
128
CC : clang
116
- SUFFIX : shared
129
+ CFLAGS : " -Wno-error=cast-align"
130
+ SUFFIX : linux-clang-shared
117
131
118
132
cmake:linux:clang:static :
119
133
extends : .cmake:linux
@@ -122,48 +136,26 @@ cmake:linux:clang:static:
122
136
variables :
123
137
BUILD_SHARED_LIBS : " OFF"
124
138
CC : clang
125
- SUFFIX : static
139
+ CFLAGS : " -Wno-error=cast-align"
140
+ SUFFIX : linux-clang-static
126
141
127
142
.cmake:mingw :
128
143
tags :
129
144
- win32-ps
145
+ variables :
146
+ CHERE_INVOKING : " yes"
130
147
before_script :
131
- - " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
132
- - $Env:Path="C:\msys64\$Env:MINGW_PATH\bin;C:\msys64\usr\bin;$Env:Path"
133
- - pacman --noconfirm -Syu
134
- - pacman --noconfirm -S
135
- $Env:MINGW_PACKAGE_PREFIX-cmake
136
- $Env:MINGW_PACKAGE_PREFIX-libiconv
137
- $Env:MINGW_PACKAGE_PREFIX-ninja
138
- $Env:MINGW_PACKAGE_PREFIX-python
139
- $Env:MINGW_PACKAGE_PREFIX-python2
140
- $Env:MINGW_PACKAGE_PREFIX-xz
141
- $Env:MINGW_PACKAGE_PREFIX-zlib
142
- - if (-not (Test-Path 7za.exe)) {
143
- Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
144
- cmake -E tar xf 7z1900-extra.7z 7za.exe
145
- }
146
- - if (-not (Test-Path libxml2-build/xmlconf)) {
147
- Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz ;
148
- .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
149
- }
148
+ - $Env:Path="C:\msys64\usr\bin;$Env:Path"
149
+ - bash -lc 'sh .gitlab-ci/setup_mingw.sh cmake ninja'
150
150
script :
151
- - cmake -G Ninja -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B libxml2-build
152
- - cmake --build libxml2-build --target install
153
- - New-Item -ItemType Directory libxml2-install\share\libxml2
154
- - Copy-Item Copyright libxml2-install\share\libxml2
155
- - cd libxml2-build
156
- - ctest -VV
157
- after_script :
158
- - .\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:MINGW_PACKAGE_PREFIX-$Env:SUFFIX.7z .\libxml2-install\*
151
+ - bash -lc 'sh .gitlab-ci/test_cmake.sh -G Ninja'
159
152
cache :
160
- key : " $MINGW_PACKAGE_PREFIX "
153
+ key : " $MSYSTEM "
161
154
paths :
162
155
- libxml2-build/xmlconf/
163
- - 7za.exe
164
156
artifacts :
165
157
paths :
166
- - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:MINGW_PACKAGE_PREFIX-$Env: SUFFIX.7z
158
+ - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:SUFFIX.tar.gz
167
159
expire_in : 1 day
168
160
169
161
cmake:mingw:w64-i686:shared :
@@ -172,69 +164,44 @@ cmake:mingw:w64-i686:shared:
172
164
- schedules
173
165
variables :
174
166
BUILD_SHARED_LIBS : " ON"
175
- MINGW_PACKAGE_PREFIX : mingw-w64-i686
176
- MINGW_PATH : mingw32
177
- SUFFIX : shared
167
+ MSYSTEM : MINGW32
168
+ SUFFIX : mingw-w64-i686-shared
178
169
179
170
cmake:mingw:w64-i686:static :
180
171
extends : .cmake:mingw
181
172
only :
182
173
- schedules
183
174
variables :
184
175
BUILD_SHARED_LIBS : " OFF"
185
- MINGW_PACKAGE_PREFIX : mingw-w64-i686
186
- MINGW_PATH : mingw32
187
- SUFFIX : static
176
+ MSYSTEM : MINGW32
177
+ SUFFIX : mingw-w64-i686-static
188
178
189
179
cmake:mingw:w64-x86_64:shared :
190
180
extends : .cmake:mingw
191
181
variables :
192
182
BUILD_SHARED_LIBS : " ON"
193
- MINGW_PACKAGE_PREFIX : mingw-w64-x86_64
194
- MINGW_PATH : mingw64
195
- SUFFIX : shared
183
+ MSYSTEM : MINGW64
184
+ SUFFIX : mingw-w64-x86_64-shared
196
185
197
186
cmake:mingw:w64-x86_64:static :
198
187
extends : .cmake:mingw
199
188
only :
200
189
- schedules
201
190
variables :
202
191
BUILD_SHARED_LIBS : " OFF"
203
- MINGW_PACKAGE_PREFIX : mingw-w64-x86_64
204
- MINGW_PATH : mingw64
205
- SUFFIX : static
192
+ MSYSTEM : MINGW64
193
+ SUFFIX : mingw-w64-x86_64-static
206
194
207
195
.cmake:msvc :
208
196
tags :
209
197
- win32-ps
210
198
variables :
199
+ # MSVC warns when casting `const char **` to `void *` which is wrong.
200
+ # Disable warning C4090.
201
+ CFLAGS : /WX /wd4090
211
202
CMAKE_VERSION : 3.19.4
212
- before_script :
213
- - " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
214
- - if (-not (Test-Path cmake-$Env:CMAKE_VERSION-win64-x64)) {
215
- Invoke-WebRequest -Uri http://github.com/Kitware/CMake/releases/download/v$Env:CMAKE_VERSION/cmake-$Env:CMAKE_VERSION-win64-x64.zip -OutFile cmake-$Env:CMAKE_VERSION-win64-x64.zip ;
216
- Expand-Archive cmake-$Env:CMAKE_VERSION-win64-x64.zip -DestinationPath .
217
- }
218
- - $Env:Path="$Env:CI_PROJECT_DIR\cmake-$Env:CMAKE_VERSION-win64-x64\bin;$Env:Path"
219
- - if (-not (Test-Path 7za.exe)) {
220
- Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
221
- cmake -E tar xf 7z1900-extra.7z 7za.exe
222
- }
223
- - if (-not (Test-Path libxml2-build/xmlconf)) {
224
- Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz ;
225
- .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
226
- }
227
203
script :
228
- - cmake -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -S . -B libxml2-build
229
- - cmake --build libxml2-build --config Debug --target install
230
- - cmake --build libxml2-build --config Release --target install
231
- - New-Item -ItemType Directory libxml2-install\share\libxml2
232
- - Copy-Item Copyright libxml2-install\share\libxml2
233
- - cd libxml2-build
234
- - ctest -C Debug -VV
235
- - ctest -C Release -VV
236
- after_script :
237
- - .\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:CMAKE_GENERATOR_TOOLSET-$Env:CMAKE_GENERATOR_PLATFORM-$Env:SUFFIX.7z .\libxml2-install\*
204
+ - .gitlab-ci/Test-Msvc
238
205
cache :
239
206
key : " msvc"
240
207
paths :
0 commit comments