-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (85 loc) · 2.96 KB
/
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
name: UI tests
on: [pull_request]
jobs:
Test:
runs-on: macos-13
name: ClickAcceptAllButtonTest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Install and run Appium Server
run: |
npm i --location=global appium
appium driver install uiautomator2
appium driver install xcuitest
appium plugin install --source=npm appium-altunity-plugin
cwd=$(pwd)
pushd "$cwd"
mkdir logs
cd logs
echo "appium" > appiumLog.txt
popd
appium --use-plugins=altunity &>logs/appiumLog.txt &
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0'
- name: Install AltTester Server
run: |
cwd=$(pwd)
pushd "$cwd"
cd logs
echo "alttester" > altTesterLog.txt
echo "alttester" > altTesterComLog.txt
wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopPackageMac__v2.1.2.zip
unzip AltTesterDesktopPackageMac__v2.1.2.zip
cd AltTesterDesktopPackageMac__v2.1.2
hdiutil attach AltTesterDesktop__v2.1.2.dmg
cp -R /Volumes/AltTesterDesktop/AltTesterDesktop.app ~
popd
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-34
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
arch: x86_64
script: echo "Generated AVD snapshot for caching."
- name: Run test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
arch: x86_64
script: |
chmod -R 777 UI-TESTS
cd ~ && AltTesterDesktop.app/Contents/MacOS/AltTesterDesktop -batchmode -nographics -port 13000 -license ${{ secrets.ALTTESTERLICENSEKEY }} -termsAndConditionsAccepted -logfile ~/work/unity-sdk/unity-sdk/logs/altTesterLog.txt &>~/work/unity-sdk/unity-sdk/logs/altTesterComLog.txt &
cd UI-TESTS && dotnet test -s android.runsettings --filter Name=ClickAcceptAllButtonTest
- name: Archive logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs
path: logs/
compression-level: 0