mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
See https://github.com/actions/virtual-environments/issues/5595 Pull Request resolved: https://github.com/pytorch/pytorch/pull/79024 Approved by: https://github.com/janeyx99
76 lines
2.1 KiB
YAML
76 lines
2.1 KiB
YAML
name: android-tests
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
# Trigger on release candidate builds
|
|
# Release candidate tags look like: v1.11.0-rc1
|
|
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
|
|
- 'ciflow/trunk/*'
|
|
- 'ciflow/android/*'
|
|
branches:
|
|
- master
|
|
- main
|
|
- release/*
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: run-android-tests-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash -e -l {0}
|
|
|
|
jobs:
|
|
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
JOB_BASE_NAME: ubuntu-latest-android-tests
|
|
steps:
|
|
- name: Setup miniconda
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
auto-update-conda: true
|
|
python-version: 3.8
|
|
activate-environment: build
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
conda install -y \
|
|
cffi \
|
|
cmake \
|
|
mkl \
|
|
mkl-include \
|
|
ninja \
|
|
numpy \
|
|
pyyaml \
|
|
requests \
|
|
setuptools \
|
|
typing_extensions
|
|
|
|
# [see note: pytorch repo ref]
|
|
- name: Checkout PyTorch
|
|
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
|
|
|
|
- name: Build PyTorch Android
|
|
run: |
|
|
# Install NDK 21 after GitHub update
|
|
# https://github.com/actions/virtual-environments/issues/5595
|
|
ANDROID_ROOT="/usr/local/lib/android"
|
|
ANDROID_SDK_ROOT="${ANDROID_ROOT}/sdk"
|
|
SDKMANAGER="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager"
|
|
echo "y" | $SDKMANAGER "ndk;21.4.7075529"
|
|
|
|
export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle"
|
|
ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK
|
|
|
|
echo "CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname "$(which conda)")/../"}" >> "${GITHUB_ENV}"
|
|
./scripts/build_pytorch_android.sh x86
|
|
|
|
- name: Run tests
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 25
|
|
script: ./android/run_tests.sh
|