-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (142 loc) · 5.63 KB
/
ci.yml
File metadata and controls
170 lines (142 loc) · 5.63 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: sdk-install-demo ci
on:
push:
branches: [ main ]
workflow_dispatch:
pull_request:
jobs:
install-sdk:
strategy:
matrix:
include:
#- name: 'macOS 26'
# os: 'macos-26'
# ANDROID_API: 28
# EMULATOR_ARCH: 'arm64-v8a'
# EMULATOR_GPU: 'swiftshader_indirect'
#- name: 'macOS 15'
# os: 'macos-15'
# ANDROID_API: 28
# EMULATOR_ARCH: 'arm64-v8a'
# EMULATOR_GPU: 'swiftshader_indirect'
#- name: 'macOS 14'
# os: 'macos-14'
# ANDROID_API: 28
# EMULATOR_ARCH: 'arm64-v8a'
# EMULATOR_GPU: 'swiftshader_indirect'
- name: 'macOS 15 Intel API 28'
os: 'macos-15-intel'
ANDROID_API: 28
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'macOS 13 API 28'
os: 'macos-13'
ANDROID_API: 28
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 28'
os: 'ubuntu-latest'
ANDROID_API: 28
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 29'
os: 'ubuntu-latest'
ANDROID_API: 29
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 30'
os: 'ubuntu-latest'
ANDROID_API: 30
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 31'
os: 'ubuntu-latest'
ANDROID_API: 31
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 32'
os: 'ubuntu-latest'
ANDROID_API: 32
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 33'
os: 'ubuntu-latest'
ANDROID_API: 33
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 34'
os: 'ubuntu-latest'
ANDROID_API: 34
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 35'
os: 'ubuntu-latest'
ANDROID_API: 35
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
- name: 'Ubuntu Latest API 36'
os: 'ubuntu-latest'
ANDROID_API: 36
EMULATOR_ARCH: 'x86_64'
EMULATOR_GPU: 'swiftshader_indirect'
fail-fast: false
runs-on: ${{ matrix.os }}
env:
ANDROID_API: ${{ matrix.ANDROID_API }}
EMULATOR_ARCH: ${{ matrix.EMULATOR_ARCH }}
EMULATOR_GPU: ${{ matrix.EMULATOR_GPU }}
EMULATOR_ENGINE: ${{ matrix.EMULATOR_ENGINE }}
ANDROID_TARGET: 'default'
#ANDROID_BUILD_TOOLS_VERSION: 36.0.0
ANDROID_BUILD_TOOLS_VERSION: 'latest'
ANDROID_EMULATOR_NAME: 'demo'
ANDROID_PROFILE: "Nexus 10"
ANDROID_CHANNEL: "3"
BUILD_TOOLS_VERSION: "35.0.0"
steps:
- uses: skiptools/actions/setup-skip@v1
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27d
- name: "Setup Environment"
run: |
echo "$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/${{ env.ANDROID_BUILD_TOOLS_VERSION }}" >> $GITHUB_PATH
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
# needed for Linux or else the emulator will be created in
# ~/.android/avd but it will be sought in ~/.config/.android/avd
if [[ "${RUNNER_OS}" == "Linux" ]]; then
echo "ANDROID_AVD_HOME=${XDG_CONFIG_HOME}/.android/avd" >> $GITHUB_ENV
fi
- uses: skiptools/swift-android-action@v2
with:
build-package: false
- name: SDKs - accept licenses
run: yes y | sdkmanager --licenses
- name: SKDs - setup build tools
run: sdkmanager --install "build-tools;${BUILD_TOOLS_VERSION}" platform-tools "platforms;android-${ANDROID_API}" --channel="${ANDROID_CHANNEL}"
- name: SKDs - setup emulator
run: sdkmanager --install emulator --channel="${ANDROID_CHANNEL}"
- name: SKDs - download required images
run: sdkmanager --install "system-images;android-${ANDROID_API};${ANDROID_TARGET};${EMULATOR_ARCH}" --channel="${ANDROID_CHANNEL}"
- name: Emulator - Create
run: avdmanager --verbose create avd --force -n "${ANDROID_EMULATOR_NAME}" --device "${ANDROID_PROFILE}" --abi "${ANDROID_TARGET}/${EMULATOR_ARCH}" --package "system-images;android-${ANDROID_API};${ANDROID_TARGET};${EMULATOR_ARCH}" --sdcard 512M
- name: Emulator - Find AVDs
run: find ~/ -type d -name '*.avd'
- name: Emulator - List AVDs
run: emulator -list-avds
- name: Emulator - Boot
run: nohup emulator -memory 4096 -avd "${ANDROID_EMULATOR_NAME}" -wipe-data -no-window -accel off -no-accel -gpu "${EMULATOR_GPU}" -no-snapshot -noaudio -no-boot-anim &
- name: ADB Wait For Device
run: adb wait-for-any-device
timeout-minutes: 3
- name: "Check Emulator"
run: |
adb shell 'echo Hello Android!'
- name: "Test Swift Package"
run: |
mkdir PackageDemo
cd PackageDemo
swift package init
swift test
skip android test --verbose --arch ${EMULATOR_ARCH}