From 9b3cc2ddc20d84089c65a397e3aedd952270dc2b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 27 Apr 2023 12:57:00 -0700 Subject: [PATCH] ci: Also test the Android recovery environment The android library is not available in the Android recovery environment. Add a CI test for building and linking fio without the android library. Signed-off-by: Bart Van Assche --- .github/workflows/ci.yml | 3 +++ ci/actions-build.sh | 6 ++++-- ci/actions-full-test.sh | 5 ++++- ci/actions-install.sh | 14 ++++++++------ ci/actions-smoke-test.sh | 5 ++++- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06e03ce3..dd2997f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,9 @@ jobs: - build: android os: ubuntu-22.04 arch: aarch64-linux-android32 + - build: android-recovery + os: ubuntu-22.04 + arch: aarch64-linux-android32 - build: windows-cygwin-64 os: windows-latest arch: x86_64 diff --git a/ci/actions-build.sh b/ci/actions-build.sh index 7146fb59..351b8d18 100755 --- a/ci/actions-build.sh +++ b/ci/actions-build.sh @@ -12,7 +12,7 @@ main() { set_ci_target_os case "${CI_TARGET_BUILD}/${CI_TARGET_OS}" in - android/*) + android*/*) export UNAME=Android if [ -z "${CI_TARGET_ARCH}" ]; then echo "Error: CI_TARGET_ARCH has not been set" @@ -20,7 +20,9 @@ main() { fi NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin export PATH="${NDK}:${PATH}" - export LIBS="-landroid" + if [ "${CI_TARGET_BUILD}" = "android" ]; then + export LIBS="-landroid" + fi CC=${NDK}/${CI_TARGET_ARCH}-clang if [ ! -e "${CC}" ]; then echo "Error: could not find ${CC}" diff --git a/ci/actions-full-test.sh b/ci/actions-full-test.sh index d1675f6e..d2fb4201 100755 --- a/ci/actions-full-test.sh +++ b/ci/actions-full-test.sh @@ -3,7 +3,10 @@ set -eu main() { - [ "${CI_TARGET_BUILD}" = android ] && return 0 + case "${CI_TARGET_BUILD}" in + android*) + return 0;; + esac echo "Running long running tests..." export PYTHONUNBUFFERED="TRUE" diff --git a/ci/actions-install.sh b/ci/actions-install.sh index 39395de8..0d73ac97 100755 --- a/ci/actions-install.sh +++ b/ci/actions-install.sh @@ -94,12 +94,14 @@ install_windows() { } 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 + case "${CI_TARGET_BUILD}" in + android*) + 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 + ;; + esac set_ci_target_os diff --git a/ci/actions-smoke-test.sh b/ci/actions-smoke-test.sh index 3196f6a1..494462ac 100755 --- a/ci/actions-smoke-test.sh +++ b/ci/actions-smoke-test.sh @@ -3,7 +3,10 @@ set -eu main() { - [ "${CI_TARGET_BUILD}" = "android" ] && return 0 + case "${CI_TARGET_BUILD}" in + android*) + return 0;; + esac echo "Running smoke tests..." make test -- 2.25.1