Skip to content

Commit

Permalink
github: Split Android CI to per ABI builds
Browse files Browse the repository at this point in the history
 - Pulled the android continuous workflow into an action
 - Split the android continuous build into 3 ABIs armv7, armv8a,
   and x86_64 (note that x86 is not present).
 - Remove the upload artifacts step from previous workflow.
   This was meant for letting client try a tip-of-tree Android
   build.  We can revisit this later. (Also removed mention
   in README.md)
 - Split the android continous into debug build and a release
   build commands, enabling deletion of intermediate output
   directory.
  • Loading branch information
poweifeng committed Sep 4, 2024
1 parent cdb539b commit c677607
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 41 deletions.
17 changes: 17 additions & 0 deletions .github/actions/android-continuous/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Android Continuous'
inputs:
build-abi:
description: 'The target platform ABI'
required: true
default: 'armeabi-v7a'
runs:
using: "composite"
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Run build script
run: |
cd build/android && printf "y" | ./build.sh continuous ${{ inputs.build-abi }}
shell: bash
47 changes: 25 additions & 22 deletions .github/workflows/android-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,35 @@ on:
- rc/**

jobs:
build-android:
name: build-android
build-android-armv7:
name: build-android-armv7
runs-on: macos-14

steps:
- uses: actions/[email protected]
- uses: actions/setup-java@v3
- name: Run Android Continuous
uses: ./.github/actions/android-continuous
with:
distribution: 'temurin'
java-version: '17'
- name: Run build script
run: |
cd build/android && printf "y" | ./build.sh continuous
- uses: actions/[email protected]
with:
name: filament-android
path: out/filament-android-release.aar
- uses: actions/[email protected]
with:
name: filamat-android-full
path: out/filamat-android-release.aar
- uses: actions/[email protected]
build-abi: armeabi-v7a

build-android-armv8a:
name: build-android-armv8a
runs-on: macos-14

steps:
- uses: actions/[email protected]
- name: Run Android Continuous
uses: ./.github/actions/android-continuous
with:
name: gltfio-android-release
path: out/gltfio-android-release.aar
- uses: actions/[email protected]
build-abi: arm64-v8a

build-android-x86_64:
name: build-android-x86_64
runs-on: macos-14

steps:
- uses: actions/[email protected]
- name: Run Android Continuous
uses: ./.github/actions/android-continuous
with:
name: filament-utils-android-release
path: out/filament-utils-android-release.aar
build-abi: x86_64
4 changes: 3 additions & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Run build script
# Only build 1 64 bit target during presubmit to cut down build times during presubmit
# Continuous builds will build everything
run: |
cd build/android && printf "y" | ./build.sh presubmit
cd build/android && printf "y" | ./build.sh presubmit arm64-v8a
build-ios:
name: build-iOS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
env:
TAG: ${{ steps.git_ref.outputs.tag }}
run: |
cd build/android && printf "y" | ./build.sh release
cd build/android && printf "y" | ./build.sh release armeabi-v7a,arm64-v8a,x86,x86_64
cd ../..
mv out/filament-android-release.aar out/filament-${TAG}-android.aar
mv out/filamat-android-release.aar out/filamat-${TAG}-android.aar
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ iOS projects can use CocoaPods to install the latest release:
pod 'Filament', '~> 1.54.1'
```

### Snapshots

If you prefer to live on the edge, you can download a continuous build by following the following
steps:

1. Find the [commit](https://github.com/google/filament/commits/main) you're interested in.
2. Click the green check mark under the commit message.
3. Click on the _Details_ link for the platform you're interested in.
4. On the top left click _Summary_, then in the _Artifacts_ section choose the desired artifact.

## Documentation

- [Filament](https://google.github.io/filament/Filament.html), an in-depth explanation of
Expand Down
22 changes: 15 additions & 7 deletions build/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,27 @@ if [[ ! -d "${ANDROID_HOME}/ndk/$FILAMENT_NDK_VERSION" ]]; then
yes | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses
${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager "ndk;$FILAMENT_NDK_VERSION"
fi

# Only build 1 64 bit target during presubmit to cut down build times during presubmit
# Continuous builds will build everything
ANDROID_ABIS=
if [[ "$TARGET" == "presubmit" ]]; then
ANDROID_ABIS="-q arm64-v8a"
fi

# Build the Android sample-gltf-viewer APK during release.
BUILD_SAMPLES=
if [[ "$TARGET" == "release" ]]; then
BUILD_SAMPLES="-k sample-gltf-viewer"
fi

function build_android() {
local ABI=$1

# Do the following in two steps so that we do not run out of space
if [[ -n "${BUILD_DEBUG}" ]]; then
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android -q ${ABI} -c ${BUILD_SAMPLES} ${GENERATE_ARCHIVES} ${BUILD_DEBUG}
rm -rf out/cmake-android-debug-*
fi
if [[ -n "${BUILD_RELEASE}" ]]; then
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android -q ${ABI} -c ${BUILD_SAMPLES} ${GENERATE_ARCHIVES} ${BUILD_RELEASE}
rm -rf out/cmake-android-release-*
fi
}

pushd `dirname $0`/../.. > /dev/null
FILAMENT_NDK_VERSION=${FILAMENT_NDK_VERSION} ./build.sh -p android $ANDROID_ABIS -c $BUILD_SAMPLES $GENERATE_ARCHIVES $BUILD_DEBUG $BUILD_RELEASE
build_android $2

0 comments on commit c677607

Please sign in to comment.