-
-
Notifications
You must be signed in to change notification settings - Fork 55
89 lines (83 loc) · 2.87 KB
/
android-smoke-test.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
on:
workflow_call:
inputs:
unity-version:
required: true
type: string
api-level:
required: true
type: string
init-type:
required: true
type: string
# Map the workflow outputs to job outputs
outputs:
status:
description: "Smoke test status"
value: ${{ jobs.run.outputs.status }}
jobs:
run:
name: Android Smoke Test
runs-on: ubuntu-latest
env:
ARTIFACTS_PATH: samples/IntegrationTest/test-artifacts/
HOMEBREW_NO_INSTALL_CLEANUP: 1
defaults:
run:
shell: pwsh
# Map the job outputs to step outputs
outputs:
status: ${{ steps.smoke-test.outputs.status }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download test app artifact
uses: actions/download-artifact@v4
with:
name: testapp-Android-compiled-${{ inputs.unity-version }}-${{ inputs.init-type }}
path: samples/IntegrationTest/Build
# See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# Make sure that the required directories and .cfg do exists. Workaround to keep ADV happy on `ubuntu-latest`.
- name: Setup Android directories
run: |
mkdir -p $HOME/.android
mkdir -p $HOME/.android/avd
touch $HOME/.android/repositories.cfg
- name: Run Android Smoke Tests
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # [email protected]
id: smoke-test
timeout-minutes: 30
with:
api-level: ${{ inputs.api-level }}
target: 'google_apis'
channel: 'stable'
force-avd-creation: true
disable-animations: true
disable-spellchecker: true
emulator-options: >
-no-window
-no-snapshot-save
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
arch: x86_64
script: |
adb wait-for-device
adb shell input keyevent 82
adb devices -l
pwsh ./scripts/smoke-test-android.ps1 -IsIntegrationTest -WarnIfFlaky
- name: Upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: testapp-android-logs-${{ inputs.api-level }}-${{ inputs.unity-version }}
path: ${{ env.ARTIFACTS_PATH }}
retention-days: 14