-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.32 KB
/
build_android.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
name: Build Android
on:
push:
branches: [ "master" ]
workflow_dispatch:
env:
BUILD_TYPE: Release
concurrency:
group: "build_android"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'adopt'
- name: Install Android NDK
run: |
mkdir -p $HOME/Android/Sdk/ndk
cd $HOME/Android/Sdk/ndk
curl -L https://dl.google.com/android/repository/android-ndk-r27b-linux.zip -o android-ndk.zip
unzip android-ndk.zip
rm android-ndk.zip
- name: Configure CMake
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_TOOLCHAIN_FILE=$HOME/Android/Sdk/ndk/android-ndk-r27b/build/cmake/android.toolchain.cmake
-DANDROID_ABI=arm64-v8a
-DANDROID_PLATFORM=android-30
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DENABLE_SHARED=On
-DCMAKE_CXX_FLAGS='-w'
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Cleanup
run: sudo rm -rf build