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 12 Apple Clang
47 - name: MacOS 12 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: $(git rev-parse HEAD~$n)" && 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-modern build
181 if: matrix.config.run_64bit_tests
183 export CXXFLAGS="-Werror -D_GLIBCXX_DEBUG"
185 make -j2 ARCH=x86-64-modern optimize=no debug=yes build
186 ../tests/signature.sh $benchref
188 - name: Test x86-64-bmi2 build
189 if: matrix.config.run_64bit_tests && runner.os != 'macOS'
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 && runner.os != 'macOS'
199 make -j2 ARCH=x86-64-avx2 build
200 ../tests/signature.sh $benchref
202 - name: Test x86-64-modern build
203 if: matrix.config.run_64bit_tests
206 make -j2 ARCH=x86-64-modern build
207 ../tests/signature.sh $benchref
209 - name: Test x86-64-ssse3 build
210 if: matrix.config.run_64bit_tests
213 make -j2 ARCH=x86-64-ssse3 build
214 ../tests/signature.sh $benchref
216 - name: Test x86-64-sse3-popcnt build
217 if: matrix.config.run_64bit_tests
220 make -j2 ARCH=x86-64-sse3-popcnt build
221 ../tests/signature.sh $benchref
223 - name: Test x86-64 build
224 if: matrix.config.run_64bit_tests
227 make -j2 ARCH=x86-64 build
228 ../tests/signature.sh $benchref
230 - name: Test general-64 build
231 if: matrix.config.run_64bit_tests
234 make -j2 ARCH=general-64 build
235 ../tests/signature.sh $benchref
239 - name: Test armv8 build
240 if: matrix.config.run_armv8_tests
242 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
243 export LDFLAGS="-static -Wno-unused-command-line-argument"
245 make -j2 ARCH=armv8 build
246 ../tests/signature.sh $benchref
250 - name: Test armv7 build
251 if: matrix.config.run_armv7_tests
253 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
254 export LDFLAGS="-static -Wno-unused-command-line-argument"
256 make -j2 ARCH=armv7 build
257 ../tests/signature.sh $benchref
259 - name: Test armv7-neon build
260 if: matrix.config.run_armv7_tests
262 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
263 export LDFLAGS="-static -Wno-unused-command-line-argument"
265 make -j2 ARCH=armv7-neon build
266 ../tests/signature.sh $benchref
270 - name: Check perft and search reproducibility
271 if: matrix.config.run_64bit_tests
274 make -j2 ARCH=x86-64-modern build
276 ../tests/reprosearch.sh