Skip to content

Commit

Permalink
CI: Make API levels architecture dependent
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Jul 20, 2024
1 parent a9971cb commit 8ff5303
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,16 @@ jobs:
- name: x86_64
triple: x86_64-linux-android
emu-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
api-level: [ 27, 31, 34 ]
- name: arm64-v8a
triple: aarch64-linux-android
# https://stackoverflow.com/questions/69297141/android-11-emulator-gives-pci-bus-not-available-for-hda
emu-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -accel off -qemu -machine virt
api-level: [ 30 ]
emu-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -accel off
# ARM64 emulation on a x86_64 host currently is only possible up to API level 27 Oreo
api-level: [ 27 ]
# Don't abort runners if a single one fails
fail-fast: false
runs-on: ${{ matrix.os }}
name: Android ${{ matrix.build-type }} ${{ matrix.arch.name }} API-${{ matrix.api-level }}
name: Android ${{ matrix.build-type }} ${{ matrix.arch.name }} API-${{ matrix.arch.api-level }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
Expand All @@ -296,12 +297,12 @@ jobs:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.arch.name }}
key: avd-${{ matrix.arch.api-level }}-${{ matrix.arch.name }}
- name: Create AVD and Snapshot for Caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
api-level: ${{ matrix.arch.api-level }}
arch: ${{ matrix.arch.name }}
force-avd-creation: false
emulator-options: ${{ matrix.arch.emu-options }}
Expand All @@ -311,7 +312,7 @@ jobs:
- name: Configure CMake
run: |
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
export CCPREFIX=$TOOLCHAIN/bin/${{ matrix.arch.triple }}${{ matrix.api-level }}
export CCPREFIX=$TOOLCHAIN/bin/${{ matrix.arch.triple }}${{ matrix.arch.api-level }}
export CC="$CCPREFIX-clang"
export CXX="$CCPREFIX-clang++"
export OBJC="$CCPREFIX-clang"
Expand All @@ -337,7 +338,7 @@ jobs:
-DCMAKE_ASM_COMPILER=$AS \
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
-DTESTS=ON \
-DANDROID_PLATFORM=android-${{ matrix.api-level }} \
-DANDROID_PLATFORM=android-${{ matrix.arch.api-level }} \
-G Ninja
- name: Build
working-directory: ${{github.workspace}}/build
Expand All @@ -346,7 +347,7 @@ jobs:
- name: Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
api-level: ${{ matrix.arch.api-level }}
arch: ${{ matrix.arch.name }}
force-avd-creation: false
emulator-options: ${{ matrix.arch.emu-options }}
Expand Down

0 comments on commit 8ff5303

Please sign in to comment.