From 58894e22d79e086883b3151d235902c07574e690 Mon Sep 17 00:00:00 2001 From: Otto Seiskari Date: Thu, 21 Jan 2021 09:02:16 +0200 Subject: [PATCH] Dockerized build (#25) * Run in a 3rd party Docker image * Docker build fixes: no sudo, install clang * Support non-default NDK install dirs --- .github/workflows/build.yml | 10 ++++++---- scripts/android/build.sh | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c561dbf..8570224 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,16 +5,18 @@ on: [push] jobs: build: runs-on: ubuntu-latest + container: + image: kunitoki/android-ndk-r21 steps: - uses: actions/checkout@v2 with: submodules: recursive - name: Install Android NDK - run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;21.0.6113669' > /dev/null 2>&1 - - name: Install GFortran & OpenGL deps + run: echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;21.0.6113669' > /dev/null 2>&1 + - name: Install build system dependencies run: | - sudo apt-get update - sudo apt-get install -y gfortran mesa-common-dev libglfw3-dev + apt-get update + apt-get install -y gfortran mesa-common-dev libglfw3-dev clang - name: Build for Linux run: | DO_CLEAR=OFF BUILD_VISUALIZATIONS=OFF ./scripts/build.sh diff --git a/scripts/android/build.sh b/scripts/android/build.sh index c4db971..e9087c3 100755 --- a/scripts/android/build.sh +++ b/scripts/android/build.sh @@ -15,7 +15,9 @@ else fi export ANDROID_HOME export ANDROID_SDK="$ANDROID_HOME" -export ANDROID_NDK="$ANDROID_HOME/ndk-bundle" +# not always installed into this default directory in, e.g., CI environments +: "${ANDROID_NDK:=$ANDROID_HOME/ndk-bundle}" +export ANDROID_NDK # Build Eigen # TODO: Move to component/eigen.sh