-
Notifications
You must be signed in to change notification settings - Fork 204
63 lines (50 loc) · 2.23 KB
/
android_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# Copyright 2022 Free Software Foundation, Inc.
#
# This file is part of VOLK
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
name: Build on Android NDK
on: [push, pull_request]
jobs:
build:
name: Build on Android NDK ${{ matrix.arch.name }}
strategy:
fail-fast: false
matrix:
arch:
- { name: armeabi-v7a, allow_fail: false }
- { name: arm64-v8a, allow_fail: false }
- { name: x86, allow_fail: false }
- { name: x86_64, allow_fail: false }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Update repositories
run: sudo apt update
# All dependencies
- name: Install dependencies
run: sudo apt install -y cmake python3-mako
# Setup Java
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
# Setup Android SDK, and auto-accept licenses
- name: Install Android SDK
run: wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip && mkdir android-sdk-linux && unzip -qq android-sdk.zip -d android-sdk-linux && export ANDROID_HOME=./android-sdk-linux && echo y | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --update && (echo y; echo y; echo y; echo y; echo y; echo y; echo y; echo y) | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=android-sdk-linux --licenses
# Call SDKManager to install the Android NDK
- name: Install Android NDK
run: $GITHUB_WORKSPACE/android-sdk-linux/cmdline-tools/bin/sdkmanager --sdk_root=$GITHUB_WORKSPACE/android-sdk-linux --install "ndk;27.2.12479018" --channel=3
# Setup build directory
- name: Setup ${{ matrix.arch.name }}
shell: bash
run: cd $GITHUB_WORKSPACE/ && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-sdk-linux/ndk/27.2.12479018/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.arch.name }} -DANDROID_PLATFORM=android-34 ..
# Build
- name: Build ${{ matrix.arch.name }}
shell: bash
run: cd $GITHUB_WORKSPACE/build && make
continue-on-error: ${{ matrix.arch.allow_fail }}