6 name: ${{ matrix.config.name }}
7 runs-on: ${{ matrix.config.os }}
9 COMPILER: ${{ matrix.config.compiler }}
10 COMP: ${{ matrix.config.comp }}
15 - name: Ubuntu 20.04 GCC
22 - name: Ubuntu 20.04 Clang
29 - name: Android NDK aarch64
31 compiler: aarch64-linux-android21-clang++
35 - name: Android NDK arm
37 compiler: armv7a-linux-androideabi21-clang++
41 - name: Linux GCC riscv64
45 run_riscv64_tests: true
46 base_image: 'riscv64/alpine:edge'
47 platform: linux/riscv64
49 - name: Linux GCC ppc64
54 base_image: 'ppc64le/alpine:latest'
55 platform: linux/ppc64le
57 - name: MacOS 13 Apple Clang
63 - name: MacOS 13 GCC 11
69 - name: Windows 2022 Mingw-w64 GCC x86_64
77 - name: Windows 2022 Mingw-w64 GCC i686
85 - name: Windows 2022 Mingw-w64 Clang x86_64
91 msys_env: clang-x86_64-clang
95 working-directory: src
96 shell: ${{ matrix.config.shell }}
98 - uses: actions/checkout@v3
102 - name: Download required linux packages
103 if: runner.os == 'Linux'
106 sudo apt install expect valgrind g++-multilib qemu-user-static
109 if: runner.os == 'Linux'
111 if [ $COMP == ndk ]; then
113 ANDROID_ROOT=/usr/local/lib/android
114 ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk
115 SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
116 echo "y" | $SDKMANAGER "ndk;$NDKV"
117 ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$NDKV
118 ANDROID_NDK_BIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
119 echo "ANDROID_NDK_BIN=$ANDROID_NDK_BIN" >> $GITHUB_ENV
123 if: matrix.config.base_image
124 uses: docker/setup-qemu-action@v2
126 - name: Set up Docker Buildx
127 if: matrix.config.base_image
128 uses: docker/setup-buildx-action@v2
130 - name: Build Docker container
131 if: matrix.config.base_image
133 docker buildx build --load -t sf_builder - << EOF
134 FROM ${{ matrix.config.base_image }}
136 RUN apk update && apk add make g++
140 - name: Download required macOS packages
141 if: runner.os == 'macOS'
142 run: brew install coreutils
144 - name: Setup msys and install required packages
145 if: runner.os == 'Windows'
146 uses: msys2/setup-msys2@v2
148 msystem: ${{ matrix.config.msys_sys }}
149 install: mingw-w64-${{ matrix.config.msys_env }} make git expect
151 - name: Download the used network from the fishtest framework
154 - name: Extract the bench number from the commit history
156 for hash in $(git rev-list -100 HEAD); do
157 benchref=$(git show -s $hash | tac | grep -m 1 -o -x '[[:space:]]*\b[Bb]ench[ :]\+[1-9][0-9]\{5,7\}\b[[:space:]]*' | sed 's/[^0-9]//g') && break || true
159 [[ -n "$benchref" ]] && echo "benchref=$benchref" >> $GITHUB_ENV && echo "From commit: $hash" && echo "Reference bench: $benchref" || echo "No bench found"
161 - name: Check compiler
163 if [ $COMP == ndk ]; then
164 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
168 - name: Test help target
176 - name: Test debug x86-32 build
177 if: matrix.config.run_32bit_tests
179 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
181 make -j2 ARCH=x86-32 optimize=no debug=yes build
182 ../tests/signature.sh $benchref
184 - name: Test x86-32 build
185 if: matrix.config.run_32bit_tests
188 make -j2 ARCH=x86-32 build
189 ../tests/signature.sh $benchref
191 - name: Test x86-32-sse41-popcnt build
192 if: matrix.config.run_32bit_tests
195 make -j2 ARCH=x86-32-sse41-popcnt build
196 ../tests/signature.sh $benchref
198 - name: Test x86-32-sse2 build
199 if: matrix.config.run_32bit_tests
202 make -j2 ARCH=x86-32-sse2 build
203 ../tests/signature.sh $benchref
205 - name: Test general-32 build
206 if: matrix.config.run_32bit_tests
209 make -j2 ARCH=general-32 build
210 ../tests/signature.sh $benchref
214 - name: Test debug x86-64-avx2 build
215 if: matrix.config.run_64bit_tests
217 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
219 make -j2 ARCH=x86-64-avx2 optimize=no debug=yes build
220 ../tests/signature.sh $benchref
222 - name: Test x86-64-bmi2 build
223 if: matrix.config.run_64bit_tests
226 make -j2 ARCH=x86-64-bmi2 build
227 ../tests/signature.sh $benchref
229 - name: Test x86-64-avx2 build
230 if: matrix.config.run_64bit_tests
233 make -j2 ARCH=x86-64-avx2 build
234 ../tests/signature.sh $benchref
236 # Test a deprecated arch
237 - name: Test x86-64-modern build
238 if: matrix.config.run_64bit_tests
241 make -j2 ARCH=x86-64-modern build
242 ../tests/signature.sh $benchref
244 - name: Test x86-64-sse41-popcnt build
245 if: matrix.config.run_64bit_tests
248 make -j2 ARCH=x86-64-sse41-popcnt build
249 ../tests/signature.sh $benchref
251 - name: Test x86-64-ssse3 build
252 if: matrix.config.run_64bit_tests
255 make -j2 ARCH=x86-64-ssse3 build
256 ../tests/signature.sh $benchref
258 - name: Test x86-64-sse3-popcnt build
259 if: matrix.config.run_64bit_tests
262 make -j2 ARCH=x86-64-sse3-popcnt build
263 ../tests/signature.sh $benchref
265 - name: Test x86-64 build
266 if: matrix.config.run_64bit_tests
269 make -j2 ARCH=x86-64 build
270 ../tests/signature.sh $benchref
272 - name: Test general-64 build
273 if: matrix.config.run_64bit_tests
276 make -j2 ARCH=general-64 build
277 ../tests/signature.sh $benchref
281 - name: Test armv8 build
282 if: matrix.config.run_armv8_tests
284 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
285 export LDFLAGS="-static -Wno-unused-command-line-argument"
287 make -j2 ARCH=armv8 build
288 ../tests/signature.sh $benchref
290 - name: Test armv8-dotprod build
291 if: matrix.config.run_armv8_tests
293 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
294 export LDFLAGS="-static -Wno-unused-command-line-argument"
296 make -j2 ARCH=armv8-dotprod build
297 ../tests/signature.sh $benchref
301 - name: Test armv7 build
302 if: matrix.config.run_armv7_tests
304 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
305 export LDFLAGS="-static -Wno-unused-command-line-argument"
307 make -j2 ARCH=armv7 build
308 ../tests/signature.sh $benchref
310 - name: Test armv7-neon build
311 if: matrix.config.run_armv7_tests
313 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
314 export LDFLAGS="-static -Wno-unused-command-line-argument"
316 make -j2 ARCH=armv7-neon build
317 ../tests/signature.sh $benchref
321 - name: Test riscv64 build
322 if: matrix.config.run_riscv64_tests
324 echo "export LDFLAGS='-static' && make clean && make -j2 ARCH=riscv64 build" > make_sf.sh
325 docker run --rm --platform ${{ matrix.config.platform }} -v ${{ github.workspace }}/src:/app sf_builder
326 ../tests/signature.sh $benchref
330 - name: Test ppc64 build
331 if: matrix.config.run_ppc64_tests
333 echo "export LDFLAGS='-static' && make clean && make -j2 ARCH=ppc-64 build" > make_sf.sh
334 docker run --rm --platform ${{ matrix.config.platform }} -v ${{ github.workspace }}/src:/app sf_builder
335 ../tests/signature.sh $benchref
339 - name: Check perft and search reproducibility
340 if: matrix.config.run_64bit_tests
343 make -j2 ARCH=x86-64-avx2 build
345 ../tests/reprosearch.sh