15 name: ${{ matrix.config.name }}
16 runs-on: ${{ matrix.config.os }}
18 COMPILER: ${{ matrix.config.compiler }}
19 COMP: ${{ matrix.config.comp }}
24 # set the variable for the required tests:
25 # run_expensive_tests: true
26 # run_32bit_tests: true
27 # run_64bit_tests: true
28 # run_armv8_tests: true
29 # run_armv7_tests: true
31 name: "Ubuntu 20.04 GCC",
35 run_expensive_tests: true,
36 run_32bit_tests: true,
37 run_64bit_tests: true,
41 name: "Ubuntu 20.04 Clang",
45 run_32bit_tests: true,
46 run_64bit_tests: true,
50 name: "Ubuntu 20.04 NDK armv8",
52 compiler: aarch64-linux-android21-clang++,
54 run_armv8_tests: true,
58 name: "Ubuntu 20.04 NDK armv7",
60 compiler: armv7a-linux-androideabi21-clang++,
62 run_armv7_tests: true,
66 name: "MacOS 10.15 Apple Clang",
70 run_64bit_tests: true,
74 name: "MacOS 10.15 GCC 10",
78 run_64bit_tests: true,
82 name: "Windows 2022 Mingw-w64 GCC x86_64",
86 run_64bit_tests: true,
92 name: "Windows 2022 Mingw-w64 GCC i686",
96 run_32bit_tests: true,
102 name: "Windows 2022 Mingw-w64 Clang x86_64",
106 run_64bit_tests: true,
108 msys_env: 'clang-x86_64',
114 working-directory: src
115 shell: ${{ matrix.config.shell }}
117 - uses: actions/checkout@v2
121 - name: Download required linux packages
122 if: runner.os == 'Linux'
125 sudo apt install expect valgrind g++-multilib qemu-user
127 - name: Setup msys and install required packages
128 if: runner.os == 'Windows'
129 uses: msys2/setup-msys2@v2
131 msystem: ${{matrix.config.msys_sys}}
132 install: mingw-w64-${{matrix.config.msys_env}}-${{matrix.config.comp}} make git expect
134 - name: Download the used network from the fishtest framework
138 - name: Extract the bench number from the commit history
140 git log HEAD | grep "\b[Bb]ench[ :]\+[0-9]\{7\}" | head -n 1 | sed "s/[^0-9]*\([0-9]*\).*/\1/g" > git_sig
141 [ -s git_sig ] && echo "benchref=$(cat git_sig)" >> $GITHUB_ENV && echo "Reference bench:" $(cat git_sig) || echo "No bench found"
143 - name: Check compiler
145 export PATH=$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
148 - name: Test help target
154 - name: Test debug x86-32 build
155 if: ${{ matrix.config.run_32bit_tests }}
157 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
159 make -j2 ARCH=x86-32 optimize=no debug=yes build
160 ../tests/signature.sh $benchref
162 - name: Test x86-32 build
163 if: ${{ matrix.config.run_32bit_tests }}
166 make -j2 ARCH=x86-32 build
167 ../tests/signature.sh $benchref
169 - name: Test x86-32-sse41-popcnt build
170 if: ${{ matrix.config.run_32bit_tests }}
173 make -j2 ARCH=x86-32-sse41-popcnt build
174 ../tests/signature.sh $benchref
176 - name: Test x86-32-sse2 build
177 if: ${{ matrix.config.run_32bit_tests }}
180 make -j2 ARCH=x86-32-sse2 build
181 ../tests/signature.sh $benchref
183 - name: Test general-32 build
184 if: ${{ matrix.config.run_32bit_tests }}
187 make -j2 ARCH=general-32 build
188 ../tests/signature.sh $benchref
192 - name: Test debug x86-64-modern build
193 if: ${{ matrix.config.run_64bit_tests }}
195 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
197 make -j2 ARCH=x86-64-modern optimize=no debug=yes build
198 ../tests/signature.sh $benchref
200 - name: Test x86-64-modern build
201 if: ${{ matrix.config.run_64bit_tests }}
204 make -j2 ARCH=x86-64-modern build
205 ../tests/signature.sh $benchref
207 - name: Test x86-64-ssse3 build
208 if: ${{ matrix.config.run_64bit_tests }}
211 make -j2 ARCH=x86-64-ssse3 build
212 ../tests/signature.sh $benchref
214 - name: Test x86-64-sse3-popcnt build
215 if: ${{ matrix.config.run_64bit_tests }}
218 make -j2 ARCH=x86-64-sse3-popcnt build
219 ../tests/signature.sh $benchref
221 - name: Test x86-64 build
222 if: ${{ matrix.config.run_64bit_tests }}
225 make -j2 ARCH=x86-64 build
226 ../tests/signature.sh $benchref
228 - name: Test general-64 build
229 if: matrix.config.run_64bit_tests
232 make -j2 ARCH=general-64 build
233 ../tests/signature.sh $benchref
235 # x86-64 with newer extensions tests
237 - name: Compile x86-64-avx2 build
238 if: ${{ matrix.config.run_64bit_tests }}
241 make -j2 ARCH=x86-64-avx2 build
243 - name: Compile x86-64-bmi2 build
244 if: ${{ matrix.config.run_64bit_tests }}
247 make -j2 ARCH=x86-64-bmi2 build
249 - name: Compile x86-64-avx512 build
250 if: ${{ matrix.config.run_64bit_tests }}
253 make -j2 ARCH=x86-64-avx512 build
255 - name: Compile x86-64-vnni512 build
256 if: ${{ matrix.config.run_64bit_tests }}
259 make -j2 ARCH=x86-64-vnni512 build
261 - name: Compile x86-64-vnni256 build
262 if: ${{ matrix.config.run_64bit_tests }}
265 make -j2 ARCH=x86-64-vnni256 build
269 - name: Test armv8 build
270 if: ${{ matrix.config.run_armv8_tests }}
272 export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
273 export LDFLAGS="-static -Wno-unused-command-line-argument"
275 make -j2 ARCH=armv8 build
276 ../tests/signature.sh $benchref
280 - name: Test armv7 build
281 if: ${{ matrix.config.run_armv7_tests }}
283 export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
284 export LDFLAGS="-static -Wno-unused-command-line-argument"
286 make -j2 ARCH=armv7 build
287 ../tests/signature.sh $benchref
289 - name: Test armv7-neon build
290 if: ${{ matrix.config.run_armv7_tests }}
292 export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
293 export LDFLAGS="-static -Wno-unused-command-line-argument"
295 make -j2 ARCH=armv7-neon build
296 ../tests/signature.sh $benchref
300 - name: Check perft and search reproducibility
301 if: ${{ matrix.config.run_64bit_tests }}
304 make -j2 ARCH=x86-64-modern build
306 ../tests/reprosearch.sh
310 - name: Run under valgrind
311 if: ${{ matrix.config.run_expensive_tests }}
313 export CXXFLAGS="-O1 -fno-inline"
315 make -j2 ARCH=x86-64-modern debug=yes optimize=no build > /dev/null
316 ../tests/instrumented.sh --valgrind
317 ../tests/instrumented.sh --valgrind-thread
319 - name: Run with UB sanitizer
320 if: ${{ matrix.config.run_expensive_tests }}
322 export CXXFLAGS="-O1 -fno-inline"
324 make -j2 ARCH=x86-64-modern sanitize=undefined optimize=no debug=yes build > /dev/null
325 ../tests/instrumented.sh --sanitizer-undefined
327 - name: Run with thread sanitizer
328 if: ${{ matrix.config.run_expensive_tests }}
330 export CXXFLAGS="-O1 -fno-inline"
332 make -j2 ARCH=x86-64-modern sanitize=thread optimize=no debug=yes build > /dev/null
333 ../tests/instrumented.sh --sanitizer-thread