Skip to content

Commit bd13bc6

Browse files
kit1980pytorchmergebot
authored andcommitted
Add run_android_tests workflow
Android emulator tests workflow on Linux Github hosted runners, for now triggers on master/main/release push. Example successful run: https://github.com/pytorch/pytorch/runs/5488927387 Pull Request resolved: #73494 Approved by: https://github.com/malfet
1 parent a64ba13 commit bd13bc6

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: android-tests
2+
3+
on:
4+
push:
5+
tags:
6+
# Trigger on release candidate builds
7+
# Release candidate tags look like: v1.11.0-rc1
8+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
9+
- 'ciflow/trunk/*'
10+
- 'ciflow/android/*'
11+
branches:
12+
- master
13+
- main
14+
- release/*
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: run-android-tests-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
19+
cancel-in-progress: true
20+
21+
defaults:
22+
run:
23+
shell: bash -e -l {0}
24+
25+
jobs:
26+
27+
build-and-test:
28+
runs-on: ubuntu-latest
29+
env:
30+
JOB_BASE_NAME: ubuntu-latest-android-tests
31+
steps:
32+
- name: Setup miniconda
33+
uses: conda-incubator/setup-miniconda@v2
34+
with:
35+
auto-update-conda: true
36+
python-version: 3.8
37+
activate-environment: build
38+
39+
- name: Install dependencies
40+
run: |
41+
conda install -y \
42+
cffi \
43+
cmake \
44+
mkl \
45+
mkl-include \
46+
ninja \
47+
numpy \
48+
pyyaml \
49+
requests \
50+
setuptools \
51+
typing_extensions
52+
53+
- name: Checkout PyTorch
54+
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
55+
with:
56+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
57+
fetch-depth: 0
58+
submodules: recursive
59+
60+
- name: Build PyTorch Android
61+
run: |
62+
export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle"
63+
echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname "$(which conda)")/../"}" >> "${GITHUB_ENV}"
64+
./scripts/build_pytorch_android.sh x86
65+
66+
- name: Run tests
67+
uses: reactivecircus/android-emulator-runner@v2
68+
with:
69+
api-level: 25
70+
script: ./android/run_tests.sh

0 commit comments

Comments
 (0)