summaryrefslogtreecommitdiffstats
path: root/src/zstd/appveyor.yml
blob: 5d77b31034816866d59f7a47951efc001d17e9c4 (plain)
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
# Following tests are run _only_ on master branch
# To reproduce these tests, it's possible to push into a branch `appveyorTest`
# or a branch `visual*`, they will intentionnally trigger `master` tests

-
  version: 1.0.{build}
  branches:
    only:
    - master
    - appveyorTest
    - /visual*/
  environment:
    matrix:
    - COMPILER: "gcc"
      HOST:     "mingw"
      PLATFORM: "x64"
      SCRIPT:   "make allzstd MOREFLAGS=-static && make -C tests fullbench-lib"
      ARTIFACT: "true"
      BUILD:    "true"
    - COMPILER: "gcc"
      HOST:     "mingw"
      PLATFORM: "x86"
      SCRIPT:   "make allzstd MOREFLAGS=-static"
      ARTIFACT: "true"
      BUILD:    "true"
    - COMPILER: "clang"
      HOST:     "mingw"
      PLATFORM: "x64"
      SCRIPT:   "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd"
      BUILD:    "true"

    - COMPILER: "gcc"
      HOST:     "mingw"
      PLATFORM: "x64"
      SCRIPT:   ""
      TEST:     "cmake"

    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "x64"
      CONFIGURATION: "Debug"
    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "Win32"
      CONFIGURATION: "Debug"
    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "x64"
      CONFIGURATION: "Release"
    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "Win32"
      CONFIGURATION: "Release"

  install:
  - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
  - SET PATH_ORIGINAL=%PATH%
  - if [%HOST%]==[mingw] (
      SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" &&
      SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" &&
      COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\make.exe &&
      COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\make.exe
    )
  - IF [%HOST%]==[visual] IF [%PLATFORM%]==[x64] (
      SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;"
    )

  build_script:
  - if [%HOST%]==[mingw] (
      ( if [%PLATFORM%]==[x64] (
        SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%"
      ) else if [%PLATFORM%]==[x86] (
        SET "PATH=%PATH_MINGW32%;%PATH_ORIGINAL%"
      ) )
    )
  - if [%HOST%]==[mingw] if [%BUILD%]==[true] (
      make -v &&
      sh -c "%COMPILER% -v" &&
      ECHO Building zlib to static link &&
      SET "CC=%COMPILER%" &&
      sh -c "cd .. && git clone --depth 1 --branch v1.2.11 https://github.com/madler/zlib" &&
      sh -c "cd ../zlib && make -f win32/Makefile.gcc libz.a"
      ECHO Building zstd &&
      SET "CPPFLAGS=-I../../zlib" &&
      SET "LDFLAGS=../../zlib/libz.a" &&
      sh -c "%SCRIPT%" &&
      ( if [%COMPILER%]==[gcc] if [%ARTIFACT%]==[true]
          ECHO Creating artifacts &&
          ECHO %cd% &&
          lib\dll\example\build_package.bat &&
          make -C programs DEBUGFLAGS= clean zstd &&
          cd programs\ && 7z a -tzip -mx9 zstd-win-binary-%PLATFORM%.zip zstd.exe &&
          appveyor PushArtifact zstd-win-binary-%PLATFORM%.zip &&
          cp zstd.exe ..\bin\zstd.exe &&
          git clone --depth 1 --branch master https://github.com/facebook/zstd &&
          cd zstd &&
          git archive --format=tar master -o zstd-src.tar &&
          ..\zstd -19 zstd-src.tar &&
          appveyor PushArtifact zstd-src.tar.zst &&
          certUtil -hashfile zstd-src.tar.zst SHA256 > zstd-src.tar.zst.sha256.sig &&
          appveyor PushArtifact zstd-src.tar.zst.sha256.sig &&
          cd ..\..\bin\ &&
          7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * &&
          appveyor PushArtifact zstd-win-release-%PLATFORM%.zip
      )
    )
  - if [%HOST%]==[visual] (
      ECHO *** &&
      ECHO *** Building Visual Studio 2008 %PLATFORM%\%CONFIGURATION% in %APPVEYOR_BUILD_FOLDER% &&
      ECHO *** &&
      msbuild "build\VS2008\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v90 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2008\bin\%PLATFORM%\%CONFIGURATION%\*.exe &&
      MD5sum build/VS2008/bin/%PLATFORM%/%CONFIGURATION%/*.exe &&
      COPY build\VS2008\bin\%PLATFORM%\%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2008_%PLATFORM%_%CONFIGURATION%.exe &&
      ECHO *** &&
      ECHO *** Building Visual Studio 2010 %PLATFORM%\%CONFIGURATION% &&
      ECHO *** &&
      msbuild "build\VS2010\zstd.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      msbuild "build\VS2010\zstd.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2010_%PLATFORM%_%CONFIGURATION%.exe &&
      ECHO *** &&
      ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% &&
      ECHO *** &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2012_%PLATFORM%_%CONFIGURATION%.exe &&
      ECHO *** &&
      ECHO *** Building Visual Studio 2013 %PLATFORM%\%CONFIGURATION% &&
      ECHO *** &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2013_%PLATFORM%_%CONFIGURATION%.exe &&
      ECHO *** &&
      ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% &&
      ECHO *** &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2015_%PLATFORM%_%CONFIGURATION%.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe tests\
    )

  test_script:
  - ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION%
  - SET "CC=gcc"
  - SET "CXX=g++"
  - if [%TEST%]==[cmake] (
      mkdir build\cmake\build &&
      cd build\cmake\build &&
      cmake -G "Visual Studio 14 2015 Win64" .. &&
      cd ..\..\.. &&
      make clean
    )
  - SET "FUZZERTEST=-T30s"
  - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] (
      CD tests &&
      SET ZSTD_BIN=./zstd.exe&&
      SET DATAGEN_BIN=./datagen.exe&&
      sh -e playTests.sh --test-large-data &&
      fullbench.exe -i1 &&
      fullbench.exe -i1 -P0 &&
      fuzzer_VS2012_%PLATFORM%_Release.exe %FUZZERTEST% &&
      fuzzer_VS2013_%PLATFORM%_Release.exe %FUZZERTEST% &&
      fuzzer_VS2015_%PLATFORM%_Release.exe %FUZZERTEST%
    )


# The following tests are for regular pushes
# into `dev` or some feature branch
# There run less tests, for shorter feedback loop

-
  version: 1.0.{build}
  environment:
    matrix:
    - COMPILER: "gcc"
      HOST:     "cygwin"
      PLATFORM: "x64"
    - COMPILER: "gcc"
      HOST:     "mingw"
      PLATFORM: "x64"
      SCRIPT:   "CPPFLAGS=-DDEBUGLEVEL=2 CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2"
    - COMPILER: "gcc"
      HOST:     "mingw"
      PLATFORM: "x86"
      SCRIPT:   "CFLAGS=-Werror make -j allzstd"
    - COMPILER: "clang"
      HOST:     "mingw"
      PLATFORM: "x64"
      SCRIPT:   "CFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make -j allzstd"

    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "x64"
      CONFIGURATION: "Debug"
    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "Win32"
      CONFIGURATION: "Debug"
    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "x64"
      CONFIGURATION: "Release"
    - COMPILER: "visual"
      HOST:     "visual"
      PLATFORM: "Win32"
      CONFIGURATION: "Release"

  install:
  - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION%
  - SET PATH_ORIGINAL=%PATH%
  - if [%HOST%]==[cygwin] (
      ECHO Installing Cygwin Packages &&
      C:\cygwin64\setup-x86_64.exe -qnNdO -R "C:\cygwin64" -g -P ^
        gcc-g++,^
        gcc,^
        cmake,^
        make
    )
  - if [%HOST%]==[mingw] (
      SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" &&
      SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" &&
      COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin\make.exe &&
      COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin\make.exe
    )
  - IF [%HOST%]==[visual] IF [%PLATFORM%]==[x64] (
      SET ADDITIONALPARAM=/p:LibraryPath="C:\Program Files\Microsoft SDKs\Windows\v7.1\lib\x64;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\lib\amd64;"
    )

  build_script:
  - ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION%
  - if [%HOST%]==[cygwin] (
      set CHERE_INVOKING=yes &&
      set CC=%COMPILER% &&
      C:\cygwin64\bin\bash --login -c "
        set -e;
        cd build/cmake;
        CFLAGS='-Werror' cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_FUZZER_FLAGS=-T30s -DZSTD_ZSTREAM_FLAGS=-T30s .;
        make -j4;
        ctest -V -L Medium;
      "
    )
  - if [%HOST%]==[mingw] (
      ( if [%PLATFORM%]==[x64] (
        SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%"
      ) else if [%PLATFORM%]==[x86] (
        SET "PATH=%PATH_MINGW32%;%PATH_ORIGINAL%"
      ) ) &&
      make -v &&
      sh -c "%COMPILER% -v" &&
      set "CC=%COMPILER%" &&
      sh -c "%SCRIPT%"
    )
  - if [%HOST%]==[visual] (
      ECHO *** &&
      ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% &&
      ECHO *** &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /p:ForceImportBeforeCppTargets=%APPVEYOR_BUILD_FOLDER%\build\VS2010\CompileAsCpp.props /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      msbuild "build\VS2010\zstd.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
      DIR build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe &&
      MD5sum build/VS2010/bin/%PLATFORM%_%CONFIGURATION%/*.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\fuzzer.exe tests\fuzzer_VS2015_%PLATFORM%_%CONFIGURATION%.exe &&
      COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe tests\
    )


  test_script:
  - ECHO Testing %COMPILER% %PLATFORM% %CONFIGURATION%
  - if [%HOST%]==[mingw] (
      set "CC=%COMPILER%" &&
      make check
    )