forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (146 loc) · 4.78 KB
/
pkgci_test_android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Copyright 2023 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: ""
runner-group:
required: true
type: string
runner-env:
required: true
type: string
write-caches:
required: true
type: string
is-pr:
required: true
type: boolean
workflow_dispatch:
inputs:
artifact_run_id:
type: string
default: ""
runner-group:
required: true
type: string
runner-env:
required: true
type: string
write-caches:
required: true
type: string
is-pr:
required: true
type: boolean
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 cmake clang ninja-build
export CC=clang
export CXX=clang++
# Android-specific setup.
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
# Build then upload.
- 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
- name: "Uploading target build dir archive"
uses: actions/upload-artifact@v4
with:
name: build-android-arm_64
path: ${{ env.IREE_TARGET_BUILD_DIR }}
if-no-files-found: error
test:
# These physical devices are not scalable. Only run on postsubmit for now.
# if: (! inputs.is-pr) # re-enable before merge
needs: cross_compile
strategy:
matrix:
target:
- device-name: pixel-6-pro
label-exclude: "^requires-gpu"
- device-name: moto-edge-x30
# Moto Edge X30 supports VK_KHR_16bit_storage for only storage
# buffers, but not uniform buffers, see
# https://vulkan.gpuinfo.org/displayreport.php?id=14481#features_extensions
# We request both bits. Disable running such tests.
label-exclude: "^requires-gpu|vulkan_uses_vk_khr_16bit_storage"
name: test_on_${{ matrix.target.device-name }}
runs-on:
- self-hosted # must come first
- runner-group=${{ inputs.runner-group }}
- environment=${{ inputs.runner-env }}
- machine-type=${{ matrix.target.device-name }}
env:
TARGET_BUILD_DIR: build-android-arm_64
steps:
- name: "Checking out repository"
uses: actions/[email protected]
- uses: actions/[email protected]
with:
name: build-android-arm_64
path: ${{ env.TARGET_BUILD_DIR }}
- name: "Examining artifact directory structure"
run: ls -R ${{ env.TARGET_BUILD_DIR }}
- name: "Examining github workspace directory structure"
run: ls -R ${{ github.workspace }}
- name: "Running tests"
env:
LABEL_EXCLUDE: ${{ matrix.target.label-exclude }}
run: |
ctest -j 4 \
--test-dir "${TARGET_BUILD_DIR}" \
--timeout=900 \
--output-on-failure \
--no-tests=error \
--label-exclude "${LABEL_EXCLUDE}"