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: MacOS 13 Apple Clang
47 - name: MacOS 13 GCC 11
53 - name: Windows 2022 Mingw-w64 GCC x86_64
61 - name: Windows 2022 Mingw-w64 GCC i686
69 - name: Windows 2022 Mingw-w64 Clang x86_64
75 msys_env: clang-x86_64-clang
79 working-directory: src
80 shell: ${{ matrix.config.shell }}
82 - uses: actions/checkout@v3
86 - name: Download required linux packages
87 if: runner.os == 'Linux'
90 sudo apt install expect valgrind g++-multilib qemu-user
93 if: runner.os == 'Linux'
95 if [ $COMP == ndk ]; then
97 ANDROID_ROOT=/usr/local/lib/android
98 ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk
99 SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
100 echo "y" | $SDKMANAGER "ndk;$NDKV"
101 ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$NDKV
102 ANDROID_NDK_BIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
103 echo "ANDROID_NDK_BIN=$ANDROID_NDK_BIN" >> $GITHUB_ENV
106 - name: Download required macOS packages
107 if: runner.os == 'macOS'
108 run: brew install coreutils
110 - name: Setup msys and install required packages
111 if: runner.os == 'Windows'
112 uses: msys2/setup-msys2@v2
114 msystem: ${{ matrix.config.msys_sys }}
115 install: mingw-w64-${{ matrix.config.msys_env }} make git expect
117 - name: Download the used network from the fishtest framework
120 - name: Extract the bench number from the commit history
122 for hash in $(git rev-list -100 HEAD); do
123 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
125 [[ -n "$benchref" ]] && echo "benchref=$benchref" >> $GITHUB_ENV && echo "From commit: $hash" && echo "Reference bench: $benchref" || echo "No bench found"
127 - name: Check compiler
129 if [ $COMP == ndk ]; then
130 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
134 - name: Test help target
142 - name: Test debug x86-32 build
143 if: matrix.config.run_32bit_tests
145 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
147 make -j2 ARCH=x86-32 optimize=no debug=yes build
148 ../tests/signature.sh $benchref
150 - name: Test x86-32 build
151 if: matrix.config.run_32bit_tests
154 make -j2 ARCH=x86-32 build
155 ../tests/signature.sh $benchref
157 - name: Test x86-32-sse41-popcnt build
158 if: matrix.config.run_32bit_tests
161 make -j2 ARCH=x86-32-sse41-popcnt build
162 ../tests/signature.sh $benchref
164 - name: Test x86-32-sse2 build
165 if: matrix.config.run_32bit_tests
168 make -j2 ARCH=x86-32-sse2 build
169 ../tests/signature.sh $benchref
171 - name: Test general-32 build
172 if: matrix.config.run_32bit_tests
175 make -j2 ARCH=general-32 build
176 ../tests/signature.sh $benchref
180 - name: Test debug x86-64-avx2 build
181 if: matrix.config.run_64bit_tests
183 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
185 make -j2 ARCH=x86-64-avx2 optimize=no debug=yes build
186 ../tests/signature.sh $benchref
188 - name: Test x86-64-bmi2 build
189 if: matrix.config.run_64bit_tests
192 make -j2 ARCH=x86-64-bmi2 build
193 ../tests/signature.sh $benchref
195 - name: Test x86-64-avx2 build
196 if: matrix.config.run_64bit_tests
199 make -j2 ARCH=x86-64-avx2 build
200 ../tests/signature.sh $benchref
202 # Test a deprecated arch
203 - name: Test x86-64-modern build
204 if: matrix.config.run_64bit_tests
207 make -j2 ARCH=x86-64-modern build
208 ../tests/signature.sh $benchref
210 - name: Test x86-64-sse41-popcnt build
211 if: matrix.config.run_64bit_tests
214 make -j2 ARCH=x86-64-sse41-popcnt build
215 ../tests/signature.sh $benchref
217 - name: Test x86-64-ssse3 build
218 if: matrix.config.run_64bit_tests
221 make -j2 ARCH=x86-64-ssse3 build
222 ../tests/signature.sh $benchref
224 - name: Test x86-64-sse3-popcnt build
225 if: matrix.config.run_64bit_tests
228 make -j2 ARCH=x86-64-sse3-popcnt build
229 ../tests/signature.sh $benchref
231 - name: Test x86-64 build
232 if: matrix.config.run_64bit_tests
235 make -j2 ARCH=x86-64 build
236 ../tests/signature.sh $benchref
238 - name: Test general-64 build
239 if: matrix.config.run_64bit_tests
242 make -j2 ARCH=general-64 build
243 ../tests/signature.sh $benchref
247 - name: Test armv8 build
248 if: matrix.config.run_armv8_tests
250 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
251 export LDFLAGS="-static -Wno-unused-command-line-argument"
253 make -j2 ARCH=armv8 build
254 ../tests/signature.sh $benchref
258 - name: Test armv7 build
259 if: matrix.config.run_armv7_tests
261 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
262 export LDFLAGS="-static -Wno-unused-command-line-argument"
264 make -j2 ARCH=armv7 build
265 ../tests/signature.sh $benchref
267 - name: Test armv7-neon build
268 if: matrix.config.run_armv7_tests
270 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
271 export LDFLAGS="-static -Wno-unused-command-line-argument"
273 make -j2 ARCH=armv7-neon build
274 ../tests/signature.sh $benchref
278 - name: Check perft and search reproducibility
279 if: matrix.config.run_64bit_tests
282 make -j2 ARCH=x86-64-avx2 build
284 ../tests/reprosearch.sh