Repository navigation
155 lines (147 loc) · 5.41 KB
/
Copy pathbuild-android.yml
File metadata and controls
155 lines (147 loc) · 5.41 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build for Android
on:
push:
branches:
- master
- main
- dev
- dev/*
- release/*
- buildme/*
- fix/*
- maharrim/*
pull_request:
branches:
- master
- main
- dev
# Least-privilege GITHUB_TOKEN scope: this workflow only checks out source
# and builds + uploads artifacts (upload-artifact uses its own per-run SAS,
# not GITHUB_TOKEN). Explicit block satisfies CodeQL rule
# actions/missing-workflow-permissions if Actions analysis is enabled.
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
jni-lifetimes:
name: Android HTTP JNI lifetime regressions
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Setup Java
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: 'temurin'
java-version: '17'
- name: Build production client and regression harness
run: >-
cmake -S tests/android-http-client -B out-http-jni -G Ninja
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake"
-DANDROID_ABI=x86_64 -DANDROID_PLATFORM=android-30
-DANDROID_STL=c++_static -DCMAKE_BUILD_TYPE=Debug
- name: Compile JNI tests
run: cmake --build out-http-jni --target android-http-client-tests --parallel 2
- name: Enable KVM
run: sudo chmod a+rw /dev/kvm
- name: Run ART reference lifetime tests with CheckJNI
uses: reactivecircus/android-emulator-runner@324029e2f414c084d8b15ba075288885e74aef9c # v2.34.0
with:
api-level: 30
arch: x86_64
target: google_apis
disable-animations: true
script: python3 tests/android-http-client/run-tests.py --sdk "$ANDROID_HOME" --library out-http-jni/libandroid-http-client-tests.so
no-exceptions:
name: Android without C++ exceptions (${{ matrix.abi }}, Room=${{ matrix.room }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
abi: [armeabi-v7a, arm64-v8a, x86, x86_64]
room: [OFF, ON]
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Configure full JNI SDK
run: >-
cmake -S tests/android-storage -B out-no-exceptions -G Ninja
-DEXPECT_ROOM=${{ matrix.room }}
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake"
-DANDROID_ABI=${{ matrix.abi }}
-DANDROID_PLATFORM=android-24
-DCMAKE_BUILD_TYPE=Debug
-DMATSDK_DISABLE_EXCEPTIONS=ON
-DMATSDK_BUILD_JNI_WRAPPER=ON
-DMATSDK_ANDROID_USE_ROOM=${{ matrix.room }}
-DMATSDK_DISABLE_LOGGING=${{ matrix.room }}
-DMATSDK_BUILD_UNIT_TESTS=OFF
-DMATSDK_BUILD_FUNC_TESTS=OFF
-DMATSDK_BUILD_TEST_TOOL=OFF
-DMATSDK_BUILD_PACKAGE=OFF
- name: Compile full SDK
run: cmake --build out-no-exceptions --target mat --parallel 2
- name: Verify storage option compatibility
run: cmake -P tests/android-storage/options-tests.cmake
build:
runs-on: windows-latest
name: Build for Android
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
submodules: false
- name: Update submodules
run: |
git submodule sync
git config --global submodule.lib/modules.update none
git -c protocol.version=2 submodule update --init --force --depth=1
- name: Setup Java
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
with:
packages: platform-tools
- name: Install NDK
run: |
java -version
gci env:* | sort-object name
new-item "$Env:USERPROFILE\.android\repositories.cfg" -ItemType "file"
echo yes | sdkmanager "ndk-bundle" "cmake;3.22.1" "ndk;27.0.12077973" --sdk_root=$Env:ANDROID_SDK_ROOT
- name: Chocolatey
run: |
choco install --no-progress -y ninja
- name: List CMake
run: |
pwd
echo "=================="
gci -r -i "CMake*" -Name
echo "=================="
gci -r -i "gtest-all*" -Name
echo "=================="
gci third_party/ -Name
echo "=================="
gci third_party/googletest -Name
- name: Gradle Build
run: |
.\gradlew.bat maesdk:assemble app:assemble
working-directory: lib\android_build
- name: Java Unit test
run: |
.\gradlew.bat maesdk:test
working-directory: lib\android_build
- name: Gradle Build without native device-ID collection
run: |
.\gradlew.bat maesdk:assembleDebug app:assembleDebug -PMATSDK_ENABLE_DEVICE_ID=OFF
working-directory: lib\android_build
- name: Upload Reports
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: reports
path: lib\android_build\maesdk\build\reports