-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathazure-pipelines.yml
282 lines (276 loc) · 11.7 KB
/
azure-pipelines.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
trigger:
- github
jobs:
- job: windows_tests
pool:
vmImage: 'windows-latest'
steps:
- script: |
git config --global core.autocrlf false
displayName: git config
- checkout: self
fetchDepth: 1
- script: |
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
mkdir tcltk & cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tcl.git
cd tcl & cd win
nmake -f makefile.vc INSTALLDIR=$(Build.SourcesDirectory)\tcldir OPTS=symbols
nmake -f makefile.vc install INSTALLDIR=$(Build.SourcesDirectory)\tcldir OPTS=symbols
displayName: Generate tcl library
- script: |
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tk.git
cd tk & cd win
nmake -f makefile.vc INSTALLDIR=$(Build.SourcesDirectory)\tcldir OPTS=symbols
nmake -f makefile.vc install INSTALLDIR=$(Build.SourcesDirectory)\tcldir OPTS=symbols
displayName: Generate tk library
- task: CMake@1
inputs:
workingDirectory: 'build'
cmakeArgs: '-DCMAKE_INSTALL_PREFIX=$(Build.SourcesDirectory)/install -DTCL_INCLUDE_PATH=$(Build.SourcesDirectory)\tcldir\include -DTCL_LIBRARY=$(Build.SourcesDirectory)\tcldir\lib\tcl86tg.lib $(Build.SourcesDirectory) -DGTEST=ON'
- task: MSBuild@1
inputs:
solution: 'build/INSTALL.vcxproj'
maximumCpuCount: true
platform: 'x64'
configuration: 'Debug'
displayName: Generate SCID
- script: build\gtest\Debug\scid_tests.exe
displayName: run scid_tests.exe
- script: |
move bin engines
move scid bin
copy $(Build.SourcesDirectory)\tcldir\bin\*.dll bin
xcopy /e $(Build.SourcesDirectory)\tcldir\lib\tcl8 lib\tcl8\
xcopy /e $(Build.SourcesDirectory)\tcldir\lib\tcl8.6 lib\tcl8.6\
xcopy /e $(Build.SourcesDirectory)\tcldir\lib\tk8.6 lib\tk8.6\
workingDirectory: '$(Build.SourcesDirectory)\install'
displayName: Add the tcl/tk library to the package
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)\install'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: windows x64'
inputs:
artifactName: scid_debug_x64
PathtoPublish: '$(build.artifactstagingdirectory)'
- job: windows_latest
pool:
vmImage: 'windows-latest'
steps:
- script: |
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
mkdir tcltk & cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tcl.git
cd tcl & cd win
nmake -f makefile.vc release OPTS=nomsvcrt INSTALLDIR=$(Build.SourcesDirectory)\tcldir
nmake -f makefile.vc install OPTS=nomsvcrt INSTALLDIR=$(Build.SourcesDirectory)\tcldir
displayName: Generate tcl library
- script: |
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tk.git
cd tk & cd win
nmake -f makefile.vc release OPTS=nomsvcrt INSTALLDIR=$(Build.SourcesDirectory)\tcldir
nmake -f makefile.vc install OPTS=nomsvcrt INSTALLDIR=$(Build.SourcesDirectory)\tcldir
displayName: Generate tk library
- task: CMake@1
inputs:
workingDirectory: 'build'
cmakeArgs: '-DCMAKE_INSTALL_PREFIX=$(Build.SourcesDirectory)/install -DTCL_INCLUDE_PATH=$(Build.SourcesDirectory)\tcldir\include $(Build.SourcesDirectory) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DWITH_MD_LIBRARY=OFF'
- task: MSBuild@1
inputs:
solution: 'build/INSTALL.vcxproj'
maximumCpuCount: true
platform: 'x64'
configuration: 'Release'
msbuildArguments: "/p:SpectreMitigation=false /p:RuntimeTypeInfo=false /p:EnableCOMDATFolding=true /p:LinkTimeCodeGeneration=UseLinkTimeCodeGeneration"
displayName: Generate SCID
- script: |
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
git clone --depth=1 https://github.com/official-stockfish/Stockfish.git stockfish
cd stockfish\src
cl /std:c++20 /DNDEBUG /DUSE_POPCNT /DUSE_AVX2 /DUSE_SSE41 /DUSE_SSSE3 /DUSE_SSE2 /GS- /MT /O2 /Oi /Ot /Oy /GL /EHsc *.cpp nnue/*.cpp nnue/features/*.cpp syzygy/*.cpp /link /LTCG /STACK:reserve=8388608 /OUT:stockfish.exe advapi32.lib
copy stockfish.exe $(Build.SourcesDirectory)\install\bin
displayName: Generate stockfish
- bash: |
networks=$(egrep -o "nn-[a-z0-9]+.nnue" stockfish/src/evaluate.h)
for nnue in $networks; do
echo "https://data.stockfishchess.org/nn/$nnue ==> install/bin/$nnue"
curl -o install/bin/$nnue https://data.stockfishchess.org/nn/$nnue
done
displayName: Download stockfish nnue
- script: |
move bin engines
move scid bin
copy $(Build.SourcesDirectory)\tcldir\bin\*.dll bin
xcopy /e $(Build.SourcesDirectory)\tcldir\lib\tcl8 lib\tcl8\
xcopy /e $(Build.SourcesDirectory)\tcldir\lib\tcl8.6 lib\tcl8.6\
xcopy /e $(Build.SourcesDirectory)\tcldir\lib\tk8.6 lib\tk8.6\
workingDirectory: '$(Build.SourcesDirectory)\install'
displayName: Add the tcl/tk library to the package
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)\install'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: windows x64'
inputs:
artifactName: scid_windows_x64
PathtoPublish: '$(build.artifactstagingdirectory)'
- job: ubuntu_latest
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
sudo apt-get update &&
sudo apt-get -y install tcl-dev cloc
displayName: download tclk
- script: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 17 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 200
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 200
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-17 200
sudo update-alternatives --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-17 200
displayName: Install Clang 17
- script: |
cloc src --exclude-dir=egtb,mtbgen,polyglot
cloc tcl --exclude-dir=lang
displayName: count line of code
- script: |
clang-format -version
clang-format -i src/codec*
clang-format -i src/movegen*
clang-format -i src/pgn*
clang-format -i src/bytebuf.h
clang-format -i src/gameview.h
clang-format -i src/namebase.h
clang-format -i src/scidbase*
if [[ -n $(git diff) ]]; then
git diff
exit -1
fi
displayName: clang-format
- script: |
mkdir build_tidy && cd build_tidy
cmake -DCMAKE_CXX_FLAGS="-g -Wall -Wextra -Werror -pedantic" -DSPELLCHKVALIDATE=ON \
-DCMAKE_CXX_COMPILER=clang++ \
$(Build.SourcesDirectory)
make VERBOSE=1
run-clang-tidy -header-filter=.* -checks=performance-*,clang-*,-clang-analyzer-security.insecureAPI.strcpy ../src 2> /dev/null
displayName: clang-tidy
- script: |
mkdir build && cd build
cmake -DCPACK_GENERATOR=DEB \
-DCPACK_DEBIAN_PACKAGE_MAINTAINER="Fulvio Benini" \
-DCPACK_DEBIAN_PACKAGE_DEPENDS=tk \
-DCPACK_DEBIAN_PACKAGE_LICENSE=GPL2 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fno-exceptions -fno-rtti" \
-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc" \
$(Build.SourcesDirectory)
make package
displayName: Generate SCID
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)/build'
Contents: '*.deb'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: debian x64'
inputs:
artifactName: scid_ubuntu_latest_x64_deb_package
PathtoPublish: '$(build.artifactstagingdirectory)'
- job: linux_static
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
mkdir tcltk && cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tcl.git
cd tcl && cd unix
./configure --prefix=$(Build.SourcesDirectory)/tcltk --disable-shared --enable-threads
make && make install
displayName: Generate tcl library
- script: |
cd tcltk
git clone --depth=1 --branch core-8-6-branch https://github.com/tcltk/tk.git
cd tk && cd unix
./configure --prefix=$(Build.SourcesDirectory)/tcltk --enable-threads
make && make install
displayName: Generate tk library
- script: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-fno-exceptions -fno-rtti" \
-DCMAKE_INSTALL_PREFIX=$(Build.SourcesDirectory)/scid_linux \
-DTCL_INCLUDE_PATH=$(Build.SourcesDirectory)/tcltk/include \
-DTCL_LIBRARY=$(Build.SourcesDirectory)/tcltk/lib/libtcl8.6.a \
-DCMAKE_CXX_STANDARD_LIBRARIES="-lz -ldl" \
-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc" \
-DCMAKE_CXX_COMPILER=g++-10 \
$(Build.SourcesDirectory)
make VERBOSE=1
make install
displayName: Generate SCID
- script: |
cd scid_linux
mv bin engines
mkdir lib
cp $(Build.SourcesDirectory)/tcltk/lib/*.so lib/
cp -R $(Build.SourcesDirectory)/tcltk/lib/tcl8 lib/
cp -R $(Build.SourcesDirectory)/tcltk/lib/tcl8.6 lib/
cp -R $(Build.SourcesDirectory)/tcltk/lib/tk8.6 lib/
cd ..
tar -zcvf '$(build.artifactstagingdirectory)/scid_linux.tar.gz' --owner=0 --group=0 scid_linux
displayName: Add the tcl/tk library to the package
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: linux static x64'
inputs:
artifactName: scid_linux_x64_static_tcl
PathtoPublish: '$(build.artifactstagingdirectory)'
- job: macOS_static
pool:
vmImage: 'macOS-latest'
steps:
- script: |
./build_app.sh
make -j VERBOSE=1
make install
displayName: Generate Scid.app
- script: |
git clone --depth=1 https://github.com/official-stockfish/Stockfish.git stockfish
cd stockfish/src
make -j build
make install BINDIR=$(Build.SourcesDirectory)/Scid.app/Contents/engines
displayName: Generate stockfish
- script: |
zip -r '$(build.artifactstagingdirectory)/scid_macos.zip' Scid.app
hdiutil create -fs "HFS+" -volname scid -srcfolder Scid.app '$(build.artifactstagingdirectory)/scid.dmg'
displayName: Create dmg package
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: macOS static x64'
inputs:
artifactName: scid_macOS_latest_64_static_tcl
PathtoPublish: '$(build.artifactstagingdirectory)'