forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
536 lines (480 loc) · 22.7 KB
/
android.yml
File metadata and controls
536 lines (480 loc) · 22.7 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
name: Android
on:
workflow_dispatch:
inputs:
target-branch:
description: 'Target branch for the build; taken from event context by default'
type: string
required: false
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
merge_group:
push:
branches:
# - master
- 'releases/**'
concurrency:
# github.ref is not unique in post-commit
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-android
cancel-in-progress: true
permissions: read-all
jobs:
Smart_CI:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false || github.run_attempt > 1
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}"
steps:
- name: checkout action
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
sparse-checkout: .github/actions/smart-ci
- name: Get affected components
id: smart_ci
uses: ./.github/actions/smart-ci
with:
repository: ${{ github.repository }}
pr: ${{ github.event.number }}
commit_sha: ${{ github.sha }}
ref_name: ${{ github.ref_name }}
component_pattern: "category: (.*)"
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
Docker:
needs: Smart_CI
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
volumes:
- /mount:/mount
outputs:
images: "${{ steps.handle_docker.outputs.images && steps.handle_docker.outputs.images || steps.mock_image.outputs.images }}"
steps:
- name: Set mock output images if pipeline should be skipped
if: ${{ needs.smart_ci.outputs.skip_workflow == 'True' }}
id: mock_image
run: echo "images={\"ov_build\":{\"ubuntu_22_04_android\":\"mock\"}}" >> "$GITHUB_OUTPUT"
- name: Checkout
if: ${{ needs.smart_ci.outputs.skip_workflow != 'True' }}
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
- uses: ./.github/actions/handle_docker
if: ${{ needs.smart_ci.outputs.skip_workflow != 'True' }}
id: handle_docker
with:
images: |
ov_build/ubuntu_22_04_android
ov_test/ubuntu_22_04_android
registry: 'openvinogithubactions.azurecr.io'
dockerfiles_root_dir: '.github/dockerfiles'
changed_components: ${{ needs.smart_ci.outputs.changed_components }}
Build:
name: Build ${{ matrix.arch }}
needs: [Smart_CI, Docker]
if: "!needs.smart_ci.outputs.skip_workflow"
timeout-minutes: 150
defaults:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
android_abi: arm64-v8a
- arch: x64
android_abi: x86_64
# - arch: riscv64 # experimental
# android_abi: riscv64
container:
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_android }}
volumes:
- /mount:/mount
- /home/runner/secrets/:/secrets:ro
options: -e SCCACHE_AZURE_BLOB_CONTAINER
env:
TARGET_BRANCH: ${{ inputs.target-branch || github.base_ref || github.event.merge_group.base_ref || github.ref }}
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
CMAKE_GENERATOR: 'Ninja'
BUILD_TYPE: Release
INSTALL_DIR: android_package
INSTALL_TEST_DIR: android_tests
CMAKE_CXX_COMPILER_LAUNCHER: sccache
CMAKE_C_COMPILER_LAUNCHER: sccache
SCCACHE_IGNORE_SERVER_IO_ERROR: 1
SCCACHE_SERVER_PORT: 35555
SCCACHE_ERROR_LOG: /__w/openvino/sccache_log.txt
SCCACHE_LOG: warn
OPENVINO_REPO: '/__w/openvino/openvino/openvino'
OPENVINO_GENAI_REPO: '/__w/openvino/openvino/openvino.genai'
BUILD_DIR: '/__w/openvino/openvino/build'
ANDROID_TOOLS: '/deps/android_tools'
ANDROID_NDK_HOME: '/deps/android_tools/ndk/29.0.14206865'
ANDROID_SDK_VERSION: 35
ANDROID_ABI_CONFIG: ${{ matrix.android_abi }}
TBB_BRANCH: 'v2022.2.0'
TBB_SRC: "/__w/openvino/openvino/build/onetbb-src"
TBB_BUILD: "/__w/openvino/openvino/build/onetbb-build"
TBB_INSTALL: "/__w/openvino/openvino/build/onetbb-install"
TBB_CMAKE_DIR: "/__w/openvino/openvino/build/onetbb-install/lib/cmake/TBB"
SCCACHE_AZURE_KEY_PREFIX: android_${{ matrix.arch }}
ARTIFACTS_SHARE: "/mount/build-artifacts"
MANIFEST_PATH: '${{ github.workspace }}/openvino/manifest.yml'
PRODUCT_TYPE: public_android_${{ matrix.arch }}_release
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
shell: bash
run: |
SCCACHE_AZURE_CONNECTION_STRING="$(cat /secrets/sccache/connection-string)"
echo "::add-mask::${SCCACHE_AZURE_CONNECTION_STRING}"
echo "SCCACHE_AZURE_CONNECTION_STRING=${SCCACHE_AZURE_CONNECTION_STRING}" >> $GITHUB_ENV
echo "✓ Connection string loaded and masked"
- name: Clone OpenVINO
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
path: 'openvino'
submodules: 'recursive'
- name: Clone OpenVINO GenAI
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
repository: 'openvinotoolkit/openvino.genai'
path: ${{ env.OPENVINO_GENAI_REPO }}
submodules: 'true'
ref: ${{ env.TARGET_BRANCH }}
- name: Generate product manifest and set CI_BUILD_NUMBER & CI_BUILD_DEV_TAG
id: create_manifest
uses: ./openvino/.github/actions/create_manifest
with:
repos: |
${{ env.OPENVINO_REPO }}
product_type: ${{ env.PRODUCT_TYPE }}
target_arch: ${{ matrix.arch }}
build_type: 'release'
save_to: ${{ env.MANIFEST_PATH }}
trigger_repo_branch: ${{ inputs.target-branch }}
#
# Print system info
#
- name: System info
uses: ./openvino/.github/actions/system_info
#
# Build
#
- name: Clean ccache stats
run: ${SCCACHE_PATH} --zero-stats
- name: Clone OneTBB
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
repository: 'oneapi-src/oneTBB'
path: ${{ env.TBB_SRC }}
submodules: 'true'
ref: ${{ env.TBB_BRANCH }}
- name: Configure OneTBB CMake project
run: |
cmake \
-G '${{ env.CMAKE_GENERATOR }}' \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ env.TBB_INSTALL }} \
-DCMAKE_TOOLCHAIN_FILE=${{ env.ANDROID_NDK_HOME }}/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${{ env.ANDROID_ABI_CONFIG }} \
-DANDROID_PLATFORM=${{ env.ANDROID_SDK_VERSION }} \
-DANDROID_STL=c++_shared \
-DTBB_TEST=OFF \
-DTBB_STRICT=OFF \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--undefined-version" \
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
-S ${TBB_SRC} \
-B ${TBB_BUILD}
- name: Build OneTBB project
run: cmake --build ${TBB_BUILD} --parallel $(nproc)
- name: Install OneTBB project
run: cmake --install ${TBB_BUILD}
- name: CMake - configure OpenVINO
run: |
cmake \
-G '${{ env.CMAKE_GENERATOR }}' \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_TOOLCHAIN_FILE=${{ env.ANDROID_NDK_HOME }}/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${{ env.ANDROID_ABI_CONFIG }} \
-DANDROID_PLATFORM=${{ env.ANDROID_SDK_VERSION }} \
-DANDROID_STL=c++_shared \
-DENABLE_TESTS=ON \
-DCPACK_ARCHIVE_COMPONENT_INSTALL=OFF \
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \
-DENABLE_STRICT_DEPENDENCIES=OFF \
-DENABLE_SYSTEM_TBB=OFF \
-DTHREADING=TBB \
-DTBB_DIR=${{ env.TBB_CMAKE_DIR }} \
-DTBBROOT=${{ env.TBB_INSTALL }} \
-DENABLE_FASTER_BUILD=ON \
-DOPENVINO_EXTRA_MODULES=${{ env.OPENVINO_GENAI_REPO }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
-DENABLE_LTO=ON \
-DENABLE_INTEL_CPU=ON \
-DENABLE_INTEL_GPU=ON \
-DENABLE_INTEL_NPU=ON \
-DENABLE_TEMPLATE=ON \
-DENABLE_PYTHON=OFF \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,max-page-size=16384" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,max-page-size=16384" \
-S ${OPENVINO_REPO} \
-B ${BUILD_DIR}
- name: CMake - build OpenVINO
run: cmake --build ${BUILD_DIR} --parallel $(nproc)
- name: Show ccache stats
run: ${SCCACHE_PATH} --show-stats
#
# Upload build logs and artifacts
#
- name: Upload build logs
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: build_logs_${{ matrix.arch }}
path: ${{ env.SCCACHE_ERROR_LOG }}
if-no-files-found: 'ignore'
- name: Prepare build and test artifacts (split)
run: |
# Prepare directories
mkdir -p ${INSTALL_TEST_DIR}/bin/intel64/Release
mkdir -p ${INSTALL_DIR}/lib
# Install tests into tests dir
cmake --install ${BUILD_DIR} --config ${{ env.BUILD_TYPE }} --prefix ${INSTALL_TEST_DIR} --component tests
# Install runtime into install dir; fallback to full install if component is unavailable
cmake --install ${BUILD_DIR} --config ${{ env.BUILD_TYPE }} --prefix ${INSTALL_DIR} --component core
cmake --install ${BUILD_DIR} --config ${{ env.BUILD_TYPE }} --prefix ${INSTALL_DIR} --component cpu
cmake --install ${BUILD_DIR} --config ${{ env.BUILD_TYPE }} --prefix ${INSTALL_DIR} --component template
# If tests were installed under tests/, move CPU test binaries to expected path
if [ -d "${INSTALL_TEST_DIR}/tests" ]; then
echo "Moving tests from ${INSTALL_TEST_DIR}/tests/ to ${INSTALL_TEST_DIR}/bin/intel64/Release/"
find ${INSTALL_TEST_DIR}/tests -name "*cpu*test*" -type f -exec cp {} ${INSTALL_TEST_DIR}/bin/intel64/Release/ \;
# Copy Template plugin library from tests installation into runtime package so tests can load it
find ${INSTALL_TEST_DIR}/tests -name "libopenvino_template_plugin*.so*" -type f -exec cp {} ${INSTALL_DIR}/runtime/lib/intel64/ \; 2>/dev/null || true
fi
# Add TBB and libc++ shared to runtime package
find ${TBB_INSTALL}/lib -name "*.so*" -type f -exec cp {} ${INSTALL_DIR}/lib/ \; 2>/dev/null || echo "No .so files in TBB_INSTALL/lib"
cp "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/${{ env.ANDROID_ABI_CONFIG }}-linux-android/libc++_shared.so" ${INSTALL_DIR}/lib/ || echo "libc++_shared.so not found"
- name: Pack openvino_package
run: tar -cvf - * | pigz > ${BUILD_DIR}/openvino_package.tar.gz
working-directory: ${{ env.INSTALL_DIR }}
- name: Pack openvino_tests
run: tar -cvf - * | pigz > ${BUILD_DIR}/openvino_tests.tar.gz
working-directory: ${{ env.INSTALL_TEST_DIR }}
- name: Upload CPU test binaries
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ov_cpu_tests_android_${{ matrix.arch }}
path: ${{ env.INSTALL_TEST_DIR }}/
if-no-files-found: 'error'
- name: Upload OpenVINO runtime package (Android)
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ov_android_package_${{ matrix.arch }}
path: ${{ env.INSTALL_DIR }}/
if-no-files-found: 'error'
- name: Store artifacts to a shared drive
id: store_artifacts
if: ${{ github.event_name != 'merge_group' }}
uses: ./openvino/.github/actions/store_artifacts
with:
artifacts: |
${{ env.BUILD_DIR }}/openvino_package.tar.gz
${{ env.BUILD_DIR }}/openvino_tests.tar.gz
${{ env.MANIFEST_PATH }}
storage_dir: ${{ env.PRODUCT_TYPE }}
storage_root: ${{ env.ARTIFACTS_SHARE }}
branch_name: ${{ inputs.target-branch }}
CXX_Unit_Tests:
needs: [Smart_CI, Docker, Build]
timeout-minutes: 120
runs-on: aks-linux-4-cores-16gb
container:
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_android }}
volumes:
- /mount:/mount
options: --device /dev/kvm
env:
ANDROID_API_LEVEL: 30
ANDROID_TARGET: google_apis
ANDROID_ARCH: x86_64
INSTALL_DIR: android_package
INSTALL_TEST_DIR: android_tests
steps:
- name: Checkout
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
- name: Download CPU test binaries
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ov_cpu_tests_android_x64
path: ${{ env.INSTALL_TEST_DIR }}
- name: Download OpenVINO runtime package (Android)
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ov_android_package_x64
path: ${{ env.INSTALL_DIR }}
- name: Setup KVM permissions
run: |
/usr/local/bin/setup-kvm.sh || true
ls -la /dev/kvm || echo "KVM device not available"
- name: Set up Java 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
- name: AVD cache
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
id: avd-cache
if: github.ref_name == 'master'
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.ANDROID_API_LEVEL }}-${{ env.ANDROID_TARGET }}-${{ env.ANDROID_ARCH }}
- name: Run CPU unit tests on emulator
id: unit-tests
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
target: ${{ env.ANDROID_TARGET }}
arch: ${{ env.ANDROID_ARCH }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -memory 4096 -partition-size 8192 -qemu -cpu host
disable-animations: true
emulator-boot-timeout: 900
script: |
set -e
adb wait-for-device
[ -f "${INSTALL_TEST_DIR}/bin/intel64/Release/ov_cpu_unit_tests" ] || { echo "Error: ov_cpu_unit_tests binary not found"; exit 1; }
chmod +x ${INSTALL_TEST_DIR}/bin/intel64/Release/ov_cpu_unit_tests
adb shell "rm -rf /data/local/tmp/ov_test && mkdir -p /data/local/tmp/ov_test/intel64/Release"
echo "Pushing unit test binary and libraries to device..."
adb push ${INSTALL_TEST_DIR}/bin/intel64/Release/ov_cpu_unit_tests /data/local/tmp/ov_test/intel64/Release/ov_cpu_unit_tests
# Push OpenVINO libraries from runtime package
for lib in ${INSTALL_DIR}/runtime/lib/intel64/*.so*; do [ -f "$lib" ] && adb push "$lib" /data/local/tmp/ov_test/; done
for lib in ${INSTALL_DIR}/lib/*.so*; do [ -f "$lib" ] && adb push "$lib" /data/local/tmp/ov_test/; done
adb shell "chmod 755 /data/local/tmp/ov_test/intel64/Release/ov_cpu_unit_tests"
echo "Running CPU unit tests..."
adb shell "cd /data/local/tmp/ov_test && export LD_LIBRARY_PATH=/data/local/tmp/ov_test:$LD_LIBRARY_PATH && timeout 1800 ./intel64/Release/ov_cpu_unit_tests --gtest_output=xml:/data/local/tmp/ov_test/unit_test_results.xml" || { echo "Unit test execution failed"; adb shell "ls -la /data/local/tmp/ov_test/"; exit 1; }
echo "Pulling unit test results..."
adb pull /data/local/tmp/ov_test/unit_test_results.xml ./unit_test_results.xml || { echo "Warning: Could not pull unit test results"; adb shell "ls -la /data/local/tmp/ov_test/"; adb shell "cat /data/local/tmp/ov_test/unit_test_results.xml" || echo "No unit test results file"; }
- name: Upload unit test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: cpu_unit_tests_results_android_x64
path: ./unit_test_results.xml
if-no-files-found: 'ignore'
CXX_Func_Tests:
needs: [Smart_CI, Docker, Build]
timeout-minutes: 20
runs-on: aks-linux-4-cores-16gb
container:
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_android }}
volumes:
- /mount:/mount
options: --device /dev/kvm
env:
ANDROID_API_LEVEL: 30
ANDROID_TARGET: google_apis
ANDROID_ARCH: x86_64
INSTALL_DIR: android_package
INSTALL_TEST_DIR: android_tests
GTEST_FILTER: '*EltwiseLayer*'
steps:
- name: Checkout
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
- name: Download CPU test binaries
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ov_cpu_tests_android_x64
path: ${{ env.INSTALL_TEST_DIR }}
- name: Download OpenVINO runtime package (Android)
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: ov_android_package_x64
path: ${{ env.INSTALL_DIR }}
- name: Setup KVM permissions
run: |
/usr/local/bin/setup-kvm.sh || true
ls -la /dev/kvm || echo "KVM device not available"
- name: Set up Java 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
- name: AVD cache
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
id: avd-cache
if: github.ref_name == 'master'
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.ANDROID_API_LEVEL }}-${{ env.ANDROID_TARGET }}-${{ env.ANDROID_ARCH }}
- name: Run CPU func tests on emulator
id: func-tests
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
target: ${{ env.ANDROID_TARGET }}
arch: ${{ env.ANDROID_ARCH }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -memory 4096 -partition-size 8192 -qemu -cpu host
disable-animations: true
emulator-boot-timeout: 900
script: |
set -e
adb wait-for-device
[ -f "${INSTALL_TEST_DIR}/bin/intel64/Release/ov_cpu_func_tests" ] || { echo "Error: ov_cpu_func_tests binary not found"; exit 1; }
chmod +x ${INSTALL_TEST_DIR}/bin/intel64/Release/ov_cpu_func_tests
adb shell "rm -rf /data/local/tmp/ov_test_func && mkdir -p /data/local/tmp/ov_test_func/intel64/Release"
echo "Pushing functional test binary and libraries to device..."
adb push ${INSTALL_TEST_DIR}/bin/intel64/Release/ov_cpu_func_tests /data/local/tmp/ov_test_func/intel64/Release/ov_cpu_func_tests
# Push OpenVINO libraries from runtime package
for lib in ${INSTALL_DIR}/runtime/lib/intel64/*.so*; do [ -f "$lib" ] && adb push "$lib" /data/local/tmp/ov_test_func/intel64/Release; done
for lib in ${INSTALL_DIR}/lib/*.so*; do [ -f "$lib" ] && adb push "$lib" /data/local/tmp/ov_test_func/intel64/Release; done
adb shell "chmod 755 /data/local/tmp/ov_test_func/intel64/Release/ov_cpu_func_tests"
echo "Running CPU functional tests..."
adb shell "cd /data/local/tmp/ov_test_func && export LD_LIBRARY_PATH=/data/local/tmp/ov_test_func/intel64/Release:$LD_LIBRARY_PATH && timeout 3600 ./intel64/Release/ov_cpu_func_tests --gtest_filter=${{ env.GTEST_FILTER }} --gtest_output=xml:/data/local/tmp/ov_test_func/intel64/Release/func_test_results.xml" || { echo "Functional test execution failed"; adb shell "ls -la /data/local/tmp/ov_test_func/intel64/Release/"; exit 1; }
echo "Pulling functional test results..."
adb pull /data/local/tmp/ov_test_func/intel64/Release/func_test_results.xml ./func_test_results.xml || { echo "Warning: Could not pull functional test results"; adb shell "ls -la /data/local/tmp/ov_test_func/intel64/Release/"; adb shell "cat /data/local/tmp/ov_test_func/intel64/Release/func_test_results.xml" || echo "No functional test results file"; }
- name: Upload functional test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: cpu_func_tests_results_android_x64
path: ./func_test_results.xml
if-no-files-found: 'ignore'
Overall_Status:
name: ci/gha_overall_status_android
needs: [Smart_CI, Build, CXX_Unit_Tests, CXX_Func_Tests]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check status of all jobs
if: >-
${{
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
}}
run: exit 1