-
Notifications
You must be signed in to change notification settings - Fork 8
103 lines (99 loc) · 3.29 KB
/
ui-tests.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
---
name: UI Tests 🧪
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build ${{ matrix.targetPlatform }} for AltTester 🛠️
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
include:
- targetPlatform: StandaloneOSX
buildMethod: MacBuilder.BuildForAltTester
buildPath: MacOS
- targetPlatform: StandaloneWindows64
buildMethod: WindowsBuilder.BuildForAltTester
buildPath: Windows64
- targetPlatform: Android
buildMethod: MobileBuilder.BuildForAltTester
buildPath: Android
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.targetPlatform }}
Library-
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: sample
buildMethod: ${{ matrix.buildMethod }}
customParameters: -logFile logFile.log -quit -batchmode
- name: List build directory
run: ls -R sample/Builds/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: sample/Builds/${{ matrix.buildPath }}
test:
name: Run ${{ matrix.targetPlatform }} UI tests 🧪
needs: build
strategy:
matrix:
include:
- targetPlatform: StandaloneOSX
runs-on: [self-hosted, macOS]
test_script: test_mac.sh
- targetPlatform: StandaloneWindows64
runs-on: [self-hosted, windows]
test_script: test_windows.ps1
- targetPlatform: Android
runs-on: [ self-hosted, macOS ]
test_script: browserstack-sdk pytest -s ./test/test_android.py
concurrency:
group: test-${{ matrix.targetPlatform }}
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/download-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: sample/Tests
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r "sample/Tests/requirements.txt"
- name: Run UI tests
env:
UNITY_APP_PATH: SampleApp.app
UNITY_APP_NAME: SampleApp
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
run: |
pwd
ls -la
cd unity-immutable-sdk/sample/Tests
chmod +x ./${{ matrix.test_script }}
./${{ matrix.test_script }}