Skip to content

Commit

Permalink
Ci andriod cache conda (#89554)
Browse files Browse the repository at this point in the history
Fixes - T137631662

Caching conda dependencies for android build workflows.
Conda dependencies have been gathered from the following workflow
1. https://github.com/pytorch/pytorch/blob/master/.github/workflows/_run_android_tests.yml

The pull request updates the action from conda-incubator/setup-miniconda@v2 to pytorch/test-infra/.github/actions/setup-miniconda@main as it supports caching.

Pull Request resolved: #89554
Approved by: https://github.com/huydhn
  • Loading branch information
PratsBhatt authored and pytorchmergebot committed Nov 28, 2022
1 parent 2661ff1 commit 6ba6b64
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/_run_android_tests.yml
Expand Up @@ -11,31 +11,16 @@ 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: Setup miniconda
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
with:
python-version: 3.8
environment-file: .github/requirements/conda-env-${{ runner.os }}-${{ runner.arch }}

- name: Build PyTorch Android
run: |
# Install NDK 21 after GitHub update
Expand All @@ -49,7 +34,7 @@ jobs:
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
${CONDA_RUN} ./scripts/build_pytorch_android.sh x86
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
Expand Down

0 comments on commit 6ba6b64

Please sign in to comment.