Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move build_and_test_android from ci.yml to pkgci.yml. #18070

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 0 additions & 152 deletions .github/workflows/build_and_test_android.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,25 +356,6 @@ jobs:
# "${DOCKER_IMAGE}" \
# "${TEST_SCRIPT}"

# Android cross-compilation and test is separated from cross_compile_and_test
# because some tests need to run on physical devices instead of emulators. And
# we need a fine-control on which tests only run on postsubmit as some devices
# are not scalable (while we want to test with Android emulator on ARM VMs on
# presubmit), which requires dynamic matrix generation (because "if" condition
# can't access matrix variable to skip certain matrix jobs for presubmit).
build_and_test_android:
needs: [setup, build_all]
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_and_test_android')
uses: ./.github/workflows/build_and_test_android.yml
with:
runner-group: ${{ needs.setup.outputs.runner-group }}
runner-env: ${{ needs.setup.outputs.runner-env }}
write-caches: ${{ needs.setup.outputs.write-caches }}
is-pr: ${{ fromJson(needs.setup.outputs.is-pr) }}
install-dir: ${{ needs.build_all.outputs.install-dir }}
install-dir-archive: ${{ needs.build_all.outputs.install-dir-archive }}
install-dir-gcs-artifact: ${{ needs.build_all.outputs.install-dir-gcs-artifact }}

##############################################################################

# Depends on all the other jobs to provide a single anchor that indicates the
Expand Down Expand Up @@ -402,7 +383,6 @@ jobs:

# Crosscompilation
# - cross_compile_and_test
- build_and_test_android
steps:
- name: "Checking out repository"
uses: actions/[email protected]
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pkgci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ jobs:
needs: [setup, build_packages]
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'test_tensorflow_cpu')
uses: ./.github/workflows/pkgci_test_tensorflow_cpu.yml

test_android:
needs: [setup, build_packages]
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'test_android')
uses: ./.github/workflows/pkgci_test_android.yml
with:
write-caches: ${{ needs.setup.outputs.write-caches }}
91 changes: 91 additions & 0 deletions .github/workflows/pkgci_test_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Workflow for Android cross-compilation and test jobs.
# The concurrency of this workflow is controlled by the caller's job.

name: PkgCI Test Android

on:
workflow_call:
inputs:
artifact_run_id:
type: string
default: ""
write-caches:
required: true
type: string
workflow_dispatch:
inputs:
artifact_run_id:
type: string
default: ""
write-caches:
required: true
type: string

permissions:
contents: read

jobs:
cross_compile:
runs-on: ubuntu-20.04
env:
PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages
VENV_DIR: ${{ github.workspace }}/.venv
IREE_TARGET_BUILD_DIR: build-android-arm_64
steps:
# General setup.
- name: "Checking out repository"
uses: actions/[email protected]
- name: "Checking out runtime submodules"
run: ./build_tools/scripts/git/update_runtime_submodules.sh
- uses: actions/[email protected]
with:
# Must match the subset of versions built in pkgci_build_packages.
python-version: "3.11"
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
save: ${{ inputs.write-caches == 1 }}
- uses: actions/[email protected]
with:
name: linux_x86_64_release_packages
path: ${{ env.PACKAGE_DOWNLOAD_DIR }}
- name: Setup base venv
run: |
./build_tools/pkgci/setup_venv.py ${VENV_DIR} \
--artifact-path=${PACKAGE_DOWNLOAD_DIR} \
--fetch-gh-workflow=${{ inputs.artifact_run_id }}
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y ninja-build
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV

- uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
- name: Build for Android
env:
IREE_HOST_BIN_DIR: ${{ env.VENV_DIR }}/bin
IREE_READ_REMOTE_CCACHE: 0
IREE_WRITE_REMOTE_CCACHE: 0
IREE_READ_LOCAL_CCACHE: 1
IREE_WRITE_LOCAL_CCACHE: ${{ inputs.write-caches }}
BUILD_PRESET: test
run: build_tools/cmake/build_android.sh

# TODO: run tests on physical devices or emulators
# * Emulators can run on the same host that ran the build
# * Physical devices could either
# A) be connected to a self-hosted build machine that runs the compiler,
# connects over ADB, and run tests
# B) be connected to a self-hosted run machine that downloads already
# compiled artifacts from a build machine and just connects over ADB
# to run tests
Loading