From 787c02a6aceba5cf9e819ce677a04556deaef847 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 22 Jun 2022 15:37:29 -0700 Subject: [PATCH] ci: Verify the Android build Let the continuous integration infrastructure verify the fio Android build in order to detect regressions in the Android build quickly. Signed-off-by: Bart Van Assche --- .github/workflows/ci.yml | 5 +++++ ci/actions-build.sh | 19 +++++++++++++++++-- ci/actions-full-test.sh | 2 ++ ci/actions-install.sh | 7 +++++++ ci/actions-smoke-test.sh | 2 ++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd8ce142..650366b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ jobs: - linux-clang - macos - linux-i686-gcc + - android include: - build: linux-gcc os: ubuntu-20.04 @@ -27,8 +28,12 @@ jobs: - build: linux-i686-gcc os: ubuntu-20.04 arch: i686 + - build: android + os: ubuntu-20.04 + arch: aarch64-linux-android32 env: + CI_TARGET_BUILD: ${{ matrix.build }} CI_TARGET_ARCH: ${{ matrix.arch }} CC: ${{ matrix.cc }} diff --git a/ci/actions-build.sh b/ci/actions-build.sh index 74a6fdcb..2b3de8e3 100755 --- a/ci/actions-build.sh +++ b/ci/actions-build.sh @@ -11,8 +11,23 @@ main() { local configure_flags=() set_ci_target_os - case "${CI_TARGET_OS}" in - "linux") + case "${CI_TARGET_BUILD}/${CI_TARGET_OS}" in + android/*) + export UNAME=Android + if [ -z "${CI_TARGET_ARCH}" ]; then + echo "Error: CI_TARGET_ARCH has not been set" + return 1 + fi + NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin + export PATH="${NDK}:${PATH}" + export LIBS="-landroid" + CC=${NDK}/${CI_TARGET_ARCH}-clang + if [ ! -e "${CC}" ]; then + echo "Error: could not find ${CC}" + return 1 + fi + ;; + */linux) case "${CI_TARGET_ARCH}" in "i686") extra_cflags="${extra_cflags} -m32" diff --git a/ci/actions-full-test.sh b/ci/actions-full-test.sh index 8282002f..d1675f6e 100755 --- a/ci/actions-full-test.sh +++ b/ci/actions-full-test.sh @@ -3,6 +3,8 @@ set -eu main() { + [ "${CI_TARGET_BUILD}" = android ] && return 0 + echo "Running long running tests..." export PYTHONUNBUFFERED="TRUE" if [[ "${CI_TARGET_ARCH}" == "arm64" ]]; then diff --git a/ci/actions-install.sh b/ci/actions-install.sh index 0e472717..ff514926 100755 --- a/ci/actions-install.sh +++ b/ci/actions-install.sh @@ -83,6 +83,13 @@ install_macos() { } main() { + if [ "${CI_TARGET_BUILD}" = "android" ]; then + echo "Installing Android NDK..." + wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip + unzip -q android-ndk-r24-linux.zip + return 0 + fi + set_ci_target_os install_function="install_${CI_TARGET_OS}" diff --git a/ci/actions-smoke-test.sh b/ci/actions-smoke-test.sh index c129c89f..3196f6a1 100755 --- a/ci/actions-smoke-test.sh +++ b/ci/actions-smoke-test.sh @@ -3,6 +3,8 @@ set -eu main() { + [ "${CI_TARGET_BUILD}" = "android" ] && return 0 + echo "Running smoke tests..." make test } -- 2.25.1