GitHub Action: upload ARM artifacts

And some clean up in other files.

closes https://github.com/official-stockfish/Stockfish/pull/4269

No functional change
This commit is contained in:
ppigazzini
2022-12-08 20:50:32 +01:00
committed by Joost VandeVondele
parent 74fb936dbd
commit aa603cfeeb
6 changed files with 137 additions and 20 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
make -j2 ARCH=x86-64-vnni256 build

View File

@@ -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 }}
../tests/instrumented.sh --${{ matrix.sanitizers.instrumented_option }}

View File

@@ -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