pytorch/.github/workflows/_run_android_tests.yml
Huy Do 72a7351993 Pin linux ninja dep to 1.10.2 (#88548)
The latest version 1.11.1 breaks PyTorch CI.  A bunch of tests are failing now in master d1ee073041.  Curiously, the latest commit 81042d3a53 looks green, but it's good to pin this dependency anyway

https://github.com/pytorch/pytorch/blob/master/.circleci/docker/requirements-ci.txt#L95-L97 has a curious note about ninja and why it's not part of the docker container (need to revisit this later on):

```
#ninja
#Description: build system.  Note that it install from
#here breaks things so it is commented out
```

This is one more reason to justify the effort to consolidating all pip and conda dependencies to get rid of this family of issue.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/88548
Approved by: https://github.com/clee2000
2022-11-07 23:53:17 +00:00

58 lines
1.7 KiB
YAML

name: android-tests
on:
workflow_call:
defaults:
run:
shell: bash -e -l {0}
jobs:
build-and-test:
runs-on: ubuntu-latest
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=1.15.1 \
cmake=3.22.1 \
mkl=2022.1.0 \
mkl-include=2022.1.0 \
ninja=1.10.2 \
numpy=1.23.3 \
pyyaml=6.0 \
requests=2.28.1 \
setuptools=65.5.0 \
typing_extensions=4.3.0
# [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