From: ppigazzini Date: Thu, 8 Dec 2022 19:50:32 +0000 (+0100) Subject: GitHub Action: upload ARM artifacts X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=aa603cfeeb6e902bcf996758515170b996ec1fb6 GitHub Action: upload ARM artifacts And some clean up in other files. closes https://github.com/official-stockfish/Stockfish/pull/4269 No functional change --- diff --git a/.github/workflows/stockfish.yml b/.github/workflows/stockfish.yml index 07ecfc07..6345b27c 100644 --- a/.github/workflows/stockfish.yml +++ b/.github/workflows/stockfish.yml @@ -19,3 +19,6 @@ jobs: Binaries: if: github.ref == 'refs/heads/master' uses: ./.github/workflows/stockfish_binaries.yml + ARM_Binaries: + if: github.ref == 'refs/heads/master' + uses: ./.github/workflows/stockfish_arm_binaries.yml diff --git a/.github/workflows/stockfish_arm_binaries.yml b/.github/workflows/stockfish_arm_binaries.yml new file mode 100644 index 00000000..cf3ae710 --- /dev/null +++ b/.github/workflows/stockfish_arm_binaries.yml @@ -0,0 +1,117 @@ +name: Stockfish +on: + workflow_call: +jobs: + Stockfish: + name: ${{ matrix.config.name }} ${{ matrix.binaries }} + runs-on: ${{ matrix.config.os }} + env: + COMPILER: ${{ matrix.config.compiler }} + COMP: ${{ matrix.config.comp }} + EMU: ${{ matrix.config.emu }} + EXT: ${{ matrix.config.ext }} + OS: ${{ matrix.config.os }} + BINARY: ${{ matrix.binaries }} + strategy: + matrix: + config: + - { + name: "Android NDK aarch64", + os: ubuntu-20.04, + compiler: aarch64-linux-android21-clang++, + emu: qemu-aarch64, + comp: ndk, + shell: 'bash {0}' + } + - { + name: "Android NDK arm", + os: ubuntu-20.04, + compiler: armv7a-linux-androideabi21-clang++, + emu: qemu-arm, + comp: ndk, + shell: 'bash {0}' + } + binaries: + - armv8 + - armv7 + - armv7-neon + exclude: + - binaries: armv8 + config: {compiler: armv7a-linux-androideabi21-clang++} + - binaries: armv7 + config: {compiler: aarch64-linux-android21-clang++} + - binaries: armv7-neon + config: {compiler: aarch64-linux-android21-clang++} + defaults: + run: + working-directory: src + shell: ${{ matrix.config.shell }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Download required linux packages + if: runner.os == 'Linux' + run: | + sudo apt update + sudo apt install qemu-user + + - name: Download the used network from the fishtest framework + run: | + make net + + - name: Check compiler + run: | + if [ $COMP == ndk ]; then + ANDROID_ROOT=/usr/local/lib/android + ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk + SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager + echo "y" | $SDKMANAGER "ndk;21.4.7075529" + ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 + export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH + fi + $COMPILER -v + + - name: Test help target + run: | + make help + + # Compile profile guided builds + + - name: Compile ${{ matrix.binaries }} build + run: | + if [ $COMP == ndk ]; then + ANDROID_ROOT=/usr/local/lib/android + ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk + SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager + echo "y" | $SDKMANAGER "ndk;21.4.7075529" + ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 + export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH + export LDFLAGS="-static -Wno-unused-command-line-argument" + fi + make clean + make -j2 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH=$EMU + make strip ARCH=$BINARY COMP=$COMP + mv ./stockfish$EXT ../stockfish-android-$BINARY$EXT + + - name: Remove non src files + run: rm -f *.o .depend *.nnue + + - name: Create tar archive. + run: | + cd .. + mkdir stockfish + cp -r src stockfish/ + cp stockfish-android-$BINARY$EXT stockfish/ + cp "Top CPU Contributors.txt" stockfish/ + cp Copying.txt stockfish/ + cp AUTHORS stockfish/ + tar -cvf stockfish-android-$BINARY.tar stockfish + + - name: Upload binaries + uses: actions/upload-artifact@v3 + with: + name: stockfish-android-${{ matrix.binaries }} + path: | + stockfish-android-${{ matrix.binaries }}.tar diff --git a/.github/workflows/stockfish_binaries.yml b/.github/workflows/stockfish_binaries.yml index 0b205ded..1fa123fa 100644 --- a/.github/workflows/stockfish_binaries.yml +++ b/.github/workflows/stockfish_binaries.yml @@ -63,8 +63,8 @@ jobs: if: runner.os == 'Windows' uses: msys2/setup-msys2@v2 with: - msystem: ${{matrix.config.msys_sys}} - install: mingw-w64-${{matrix.config.msys_env}} make git expect + msystem: ${{ matrix.config.msys_sys }} + install: mingw-w64-${{ matrix.config.msys_env }} make - name: Download the used network from the fishtest framework run: | @@ -72,7 +72,6 @@ jobs: - name: Check compiler run: | - export PATH=$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin $COMPILER -v - name: Test help target @@ -85,7 +84,7 @@ jobs: run: | make clean make -j2 profile-build ARCH=$BINARY COMP=$COMP - strip ./stockfish$EXT + make strip ARCH=$BINARY COMP=$COMP mv ./stockfish$EXT ../stockfish-$OS-$BINARY$EXT - name: Remove non src files diff --git a/.github/workflows/stockfish_compile_test.yml b/.github/workflows/stockfish_compile_test.yml index 63136737..8467f52d 100644 --- a/.github/workflows/stockfish_compile_test.yml +++ b/.github/workflows/stockfish_compile_test.yml @@ -72,7 +72,7 @@ jobs: uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.config.msys_sys}} - install: mingw-w64-${{matrix.config.msys_env}} make git expect + install: mingw-w64-${{matrix.config.msys_env}} make - name: Download the used network from the fishtest framework run: | @@ -80,7 +80,6 @@ jobs: - name: Check compiler run: | - export PATH=$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin $COMPILER -v - name: Test help target @@ -112,4 +111,4 @@ jobs: - name: Compile x86-64-vnni256 build run: | make clean - make -j2 ARCH=x86-64-vnni256 build \ No newline at end of file + make -j2 ARCH=x86-64-vnni256 build diff --git a/.github/workflows/stockfish_sanitizers.yml b/.github/workflows/stockfish_sanitizers.yml index 61eaf0c9..b74c2f97 100644 --- a/.github/workflows/stockfish_sanitizers.yml +++ b/.github/workflows/stockfish_sanitizers.yml @@ -52,7 +52,7 @@ jobs: - name: Download required linux packages run: | sudo apt update - sudo apt install expect valgrind g++-multilib qemu-user + sudo apt install expect valgrind g++-multilib - name: Download the used network from the fishtest framework run: | @@ -60,7 +60,6 @@ jobs: - name: Check compiler run: | - export PATH=$PATH:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin $COMPILER -v - name: Test help target @@ -74,4 +73,4 @@ jobs: export CXXFLAGS="-O1 -fno-inline" make clean make -j2 ARCH=x86-64-modern ${{ matrix.sanitizers.make_option }} debug=yes optimize=no build > /dev/null - ../tests/instrumented.sh --${{ matrix.sanitizers.instrumented_option }} \ No newline at end of file + ../tests/instrumented.sh --${{ matrix.sanitizers.instrumented_option }} diff --git a/.github/workflows/stockfish_test.yml b/.github/workflows/stockfish_test.yml index e4e6205f..3cb89d39 100644 --- a/.github/workflows/stockfish_test.yml +++ b/.github/workflows/stockfish_test.yml @@ -31,7 +31,7 @@ jobs: shell: 'bash {0}' } - { - name: "Ubuntu 20.04 NDK armv8", + name: "Android NDK aarch64", os: ubuntu-20.04, compiler: aarch64-linux-android21-clang++, comp: ndk, @@ -39,7 +39,7 @@ jobs: shell: 'bash {0}' } - { - name: "Ubuntu 20.04 NDK armv7", + name: "Android NDK arm", os: ubuntu-20.04, compiler: armv7a-linux-androideabi21-clang++, comp: ndk, @@ -127,8 +127,8 @@ jobs: run: | if [ $COMP == ndk ]; then ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager + ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk + SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager echo "y" | $SDKMANAGER "ndk;21.4.7075529" ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH @@ -228,8 +228,8 @@ jobs: if: ${{ matrix.config.run_armv8_tests }} run: | ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager + ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk + SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager echo "y" | $SDKMANAGER "ndk;21.4.7075529" ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH @@ -244,8 +244,8 @@ jobs: if: ${{ matrix.config.run_armv7_tests }} run: | ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager + ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk + SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager echo "y" | $SDKMANAGER "ndk;21.4.7075529" ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH @@ -258,8 +258,8 @@ jobs: if: ${{ matrix.config.run_armv7_tests }} run: | ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager + ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk + SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager echo "y" | $SDKMANAGER "ndk;21.4.7075529" ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH