14 name: ${{ matrix.config.name }}
15 runs-on: ${{ matrix.config.os }}
17 COMPILER: ${{ matrix.config.compiler }}
18 COMP: ${{ matrix.config.comp }}
23 # set the variable for the required tests:
24 # run_expensive_tests: true
25 # run_32bit_tests: true
26 # run_64bit_tests: true
27 # run_armv8_tests: true
28 # run_armv7_tests: true
30 name: "Ubuntu 20.04 GCC",
34 run_expensive_tests: true,
35 run_32bit_tests: true,
36 run_64bit_tests: true,
40 name: "Ubuntu 20.04 Clang",
44 run_32bit_tests: true,
45 run_64bit_tests: true,
49 name: "Ubuntu 20.04 NDK armv8",
51 compiler: aarch64-linux-android21-clang++,
53 run_armv8_tests: false,
57 name: "Ubuntu 20.04 NDK armv7",
59 compiler: armv7a-linux-androideabi21-clang++,
61 run_armv7_tests: false,
65 name: "MacOS 10.15 Apple Clang",
69 run_64bit_tests: true,
73 name: "MacOS 10.15 GCC 10",
77 run_64bit_tests: true,
81 name: "Windows 2022 Mingw-w64 GCC x86_64",
85 run_64bit_tests: true,
87 msys_env: 'x86_64-gcc',
91 name: "Windows 2022 Mingw-w64 GCC i686",
95 run_32bit_tests: true,
101 name: "Windows 2022 Mingw-w64 Clang x86_64",
105 run_64bit_tests: true,
107 msys_env: 'clang-x86_64-clang',
113 working-directory: src
114 shell: ${{ matrix.config.shell }}
116 - uses: actions/checkout@v2
120 - name: Download required linux packages
121 if: runner.os == 'Linux'
124 sudo apt install expect valgrind g++-multilib qemu-user
126 - name: Setup msys and install required packages
127 if: runner.os == 'Windows'
128 uses: msys2/setup-msys2@v2
130 msystem: ${{matrix.config.msys_sys}}
131 install: mingw-w64-${{matrix.config.msys_env}} make git expect
133 - name: Download the used network from the fishtest framework
137 - name: Extract the bench number from the commit history
139 git log HEAD | grep "\b[Bb]ench[ :]\+[0-9]\{7\}" | head -n 1 | sed "s/[^0-9]*\([0-9]*\).*/\1/g" > git_sig
140 [ -s git_sig ] && echo "benchref=$(cat git_sig)" >> $GITHUB_ENV && echo "Reference bench:" $(cat git_sig) || echo "No bench found"
142 - name: Check compiler
144 export PATH=$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
147 - name: Test help target
153 - name: Test debug x86-32 build
154 if: ${{ matrix.config.run_32bit_tests }}
156 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
158 make -j2 ARCH=x86-32 optimize=no debug=yes build
159 ../tests/signature.sh $benchref
161 - name: Test x86-32 build
162 if: ${{ matrix.config.run_32bit_tests }}
165 make -j2 ARCH=x86-32 build
166 ../tests/signature.sh $benchref
168 - name: Test x86-32-sse41-popcnt build
169 if: ${{ matrix.config.run_32bit_tests }}
172 make -j2 ARCH=x86-32-sse41-popcnt build
173 ../tests/signature.sh $benchref
175 - name: Test x86-32-sse2 build
176 if: ${{ matrix.config.run_32bit_tests }}
179 make -j2 ARCH=x86-32-sse2 build
180 ../tests/signature.sh $benchref
182 - name: Test general-32 build
183 if: ${{ matrix.config.run_32bit_tests }}
186 make -j2 ARCH=general-32 build
187 ../tests/signature.sh $benchref
191 - name: Test debug x86-64-modern build
192 if: ${{ matrix.config.run_64bit_tests }}
194 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
196 make -j2 ARCH=x86-64-modern optimize=no debug=yes build
197 ../tests/signature.sh $benchref
199 - name: Test x86-64-modern build
200 if: ${{ matrix.config.run_64bit_tests }}
203 make -j2 ARCH=x86-64-modern build
204 ../tests/signature.sh $benchref
206 - name: Test x86-64-ssse3 build
207 if: ${{ matrix.config.run_64bit_tests }}
210 make -j2 ARCH=x86-64-ssse3 build
211 ../tests/signature.sh $benchref
213 - name: Test x86-64-sse3-popcnt build
214 if: ${{ matrix.config.run_64bit_tests }}
217 make -j2 ARCH=x86-64-sse3-popcnt build
218 ../tests/signature.sh $benchref
220 - name: Test x86-64 build
221 if: ${{ matrix.config.run_64bit_tests }}
224 make -j2 ARCH=x86-64 build
225 ../tests/signature.sh $benchref
227 - name: Test general-64 build
228 if: matrix.config.run_64bit_tests
231 make -j2 ARCH=general-64 build
232 ../tests/signature.sh $benchref
234 # x86-64 with newer extensions tests
236 - name: Compile x86-64-avx2 build
237 if: ${{ matrix.config.run_64bit_tests }}
240 make -j2 ARCH=x86-64-avx2 build
242 - name: Compile x86-64-bmi2 build
243 if: ${{ matrix.config.run_64bit_tests }}
246 make -j2 ARCH=x86-64-bmi2 build
248 - name: Compile x86-64-avx512 build
249 if: ${{ matrix.config.run_64bit_tests }}
252 make -j2 ARCH=x86-64-avx512 build
254 - name: Compile x86-64-vnni512 build
255 if: ${{ matrix.config.run_64bit_tests }}
258 make -j2 ARCH=x86-64-vnni512 build
260 - name: Compile x86-64-vnni256 build
261 if: ${{ matrix.config.run_64bit_tests }}
264 make -j2 ARCH=x86-64-vnni256 build
268 - name: Test armv8 build
269 if: ${{ matrix.config.run_armv8_tests }}
271 ANDROID_ROOT=/usr/local/lib/android
272 ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
273 SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
274 echo "y" | $SDKMANAGER "ndk;21.4.7075529"
275 ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
276 ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT
277 export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
278 export LDFLAGS="-static -Wno-unused-command-line-argument"
280 make -j2 ARCH=armv8 build
281 ../tests/signature.sh $benchref
285 - name: Test armv7 build
286 if: ${{ matrix.config.run_armv7_tests }}
288 ANDROID_ROOT=/usr/local/lib/android
289 ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
290 SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
291 echo "y" | $SDKMANAGER "ndk;21.4.7075529"
292 ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
293 ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT
294 export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
295 export LDFLAGS="-static -Wno-unused-command-line-argument"
297 make -j2 ARCH=armv7 build
298 ../tests/signature.sh $benchref
300 - name: Test armv7-neon build
301 if: ${{ matrix.config.run_armv7_tests }}
303 ANDROID_ROOT=/usr/local/lib/android
304 ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
305 SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
306 echo "y" | $SDKMANAGER "ndk;21.4.7075529"
307 ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
308 ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT
309 export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
310 export LDFLAGS="-static -Wno-unused-command-line-argument"
312 make -j2 ARCH=armv7-neon build
313 ../tests/signature.sh $benchref
317 - name: Check perft and search reproducibility
318 if: ${{ matrix.config.run_64bit_tests }}
321 make -j2 ARCH=x86-64-modern build
323 ../tests/reprosearch.sh
327 - name: Run under valgrind
328 if: ${{ matrix.config.run_expensive_tests }}
330 export CXXFLAGS="-O1 -fno-inline"
332 make -j2 ARCH=x86-64-modern debug=yes optimize=no build > /dev/null
333 ../tests/instrumented.sh --valgrind
334 ../tests/instrumented.sh --valgrind-thread
336 - name: Run with UB sanitizer
337 if: ${{ matrix.config.run_expensive_tests }}
339 export CXXFLAGS="-O1 -fno-inline"
341 make -j2 ARCH=x86-64-modern sanitize=undefined optimize=no debug=yes build > /dev/null
342 ../tests/instrumented.sh --sanitizer-undefined
344 - name: Run with thread sanitizer
345 if: ${{ matrix.config.run_expensive_tests }}
347 export CXXFLAGS="-O1 -fno-inline"
349 make -j2 ARCH=x86-64-modern sanitize=thread optimize=no debug=yes build > /dev/null
350 ../tests/instrumented.sh --sanitizer-thread