|
1 |
| ---- |
2 |
| -name: UI Tests 🧪 |
3 | 1 |
|
4 |
| -on: |
5 |
| - push: |
6 |
| - branches: [main] |
7 |
| - pull_request: |
8 |
| - workflow_dispatch: |
9 | 2 |
|
10 |
| -concurrency: |
11 |
| - group: ${{ github.workflow }}-${{ github.ref }} |
12 |
| - cancel-in-progress: true |
| 3 | +# --- |
| 4 | +# name: UI Tests 🧪 |
13 | 5 |
|
14 |
| -jobs: |
15 |
| - build: |
16 |
| - name: Build ${{ matrix.targetPlatform }} for AltTester 🛠️ |
17 |
| - runs-on: ubuntu-latest-8-cores |
18 |
| - strategy: |
19 |
| - fail-fast: false |
20 |
| - matrix: |
21 |
| - include: |
22 |
| - - targetPlatform: StandaloneOSX |
23 |
| - buildMethod: MacBuilder.BuildForAltTester |
24 |
| - buildPath: sample/Builds/MacOS |
25 |
| - steps: |
26 |
| - - uses: actions/checkout@v3 |
27 |
| - with: |
28 |
| - lfs: true |
29 |
| - - uses: actions/cache@v3 |
30 |
| - with: |
31 |
| - path: Library |
32 |
| - key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }} |
33 |
| - restore-keys: | |
34 |
| - Library-${{ matrix.targetPlatform }} |
35 |
| - Library- |
36 |
| - - name: Build project |
37 |
| - uses: game-ci/unity-builder@v4 |
38 |
| - env: |
39 |
| - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} |
40 |
| - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} |
41 |
| - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} |
42 |
| - with: |
43 |
| - targetPlatform: ${{ matrix.targetPlatform }} |
44 |
| - projectPath: sample |
45 |
| - buildMethod: ${{ matrix.buildMethod }} |
46 |
| - customParameters: -logFile logFile.log -quit -batchmode |
47 |
| - - name: List build directory |
48 |
| - run: ls -R ./ |
49 |
| - - name: Upload artifact |
50 |
| - uses: actions/upload-artifact@v4 |
51 |
| - if: always() |
52 |
| - with: |
53 |
| - name: Build-${{ matrix.targetPlatform }} |
54 |
| - path: ${{ matrix.buildPath }} |
55 |
| - test: |
56 |
| - name: Run ${{ matrix.targetPlatform }} UI tests 🧪 |
57 |
| - needs: build |
58 |
| - strategy: |
59 |
| - matrix: |
60 |
| - include: |
61 |
| - - targetPlatform: StandaloneOSX |
62 |
| - test_script: pytest -xs test/test_mac_2.py::MacTest2 |
63 |
| - concurrency: |
64 |
| - group: test-${{ matrix.targetPlatform }} |
65 |
| - runs-on: ubuntu-latest-8-cores |
66 |
| - steps: |
67 |
| - - uses: actions/checkout@v3 |
68 |
| - with: |
69 |
| - lfs: true |
70 |
| - - uses: actions/download-artifact@v4 |
71 |
| - with: |
72 |
| - name: Build-${{ matrix.targetPlatform }} |
73 |
| - path: sample/Tests |
74 |
| - - name: Make macOS artifact executable |
75 |
| - if: ${{ matrix.targetPlatform == 'StandaloneOSX' }} |
76 |
| - run: chmod +x sample/Tests/SampleApp.app/Contents/MacOS/* |
77 |
| - - uses: actions/setup-python@v4 |
78 |
| - with: |
79 |
| - python-version: "3.10" |
80 |
| - - name: Install dependencies (Mac) |
81 |
| - if: ${{ matrix.targetPlatform != 'StandaloneWindows64' }} |
82 |
| - run: | |
83 |
| - if [[ "${{ matrix.targetPlatform }}" == "StandaloneOSX" ]]; then |
84 |
| - pip uninstall -y browserstack-sdk || true |
85 |
| - pip install -r "sample/Tests/requirements-desktop.txt" |
86 |
| - else |
87 |
| - pip install -r "sample/Tests/requirements-mobile.txt" |
88 |
| - fi |
89 |
| - - name: Run UI tests |
90 |
| - env: |
91 |
| - UNITY_APP_PATH: SampleApp.app |
92 |
| - UNITY_APP_NAME: SampleApp |
93 |
| - MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }} |
94 |
| - working-directory: sample/Tests |
95 |
| - run: ${{ matrix.test_script }} |
96 |
| - test-ios: |
97 |
| - name: Run iOS UI tests 🧪 |
98 |
| - runs-on: [ self-hosted, macOS ] |
99 |
| - steps: |
100 |
| - - uses: actions/checkout@v3 |
101 |
| - with: |
102 |
| - lfs: true |
103 |
| - - name: Build iOS app |
104 |
| - working-directory: sample |
105 |
| - run: ./build_ios.sh |
106 |
| - - uses: actions/setup-python@v4 |
107 |
| - with: |
108 |
| - python-version: "3.10" |
109 |
| - - name: Install dependencies |
110 |
| - run: pip install -r "sample/Tests/requirements-mobile.txt" |
111 |
| - - name: Run UI tests |
112 |
| - env: |
113 |
| - MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }} |
114 |
| - BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
115 |
| - BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
116 |
| - working-directory: sample/Tests |
117 |
| - run: browserstack-sdk pytest -s ./test/test_ios.py --browserstack.config "browserstack.ios.yml" |
| 6 | +# on: |
| 7 | +# push: |
| 8 | +# branches: [main] |
| 9 | +# pull_request: |
| 10 | + |
| 11 | +# concurrency: |
| 12 | +# group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | +# cancel-in-progress: true |
| 14 | + |
| 15 | +# jobs: |
| 16 | +# build: |
| 17 | +# name: Build ${{ matrix.targetPlatform }} for AltTester 🛠️ |
| 18 | +# runs-on: ubuntu-latest-8-cores |
| 19 | +# strategy: |
| 20 | +# fail-fast: false |
| 21 | +# matrix: |
| 22 | +# include: |
| 23 | +# - targetPlatform: StandaloneOSX |
| 24 | +# buildMethod: MacBuilder.BuildForAltTester |
| 25 | +# buildPath: sample/Builds/MacOS |
| 26 | +# - targetPlatform: StandaloneWindows64 |
| 27 | +# buildMethod: WindowsBuilder.BuildForAltTester |
| 28 | +# buildPath: sample/Builds/Windows64 |
| 29 | +# - targetPlatform: Android |
| 30 | +# buildMethod: MobileBuilder.BuildForAltTester |
| 31 | +# buildPath: sample/Builds/Android |
| 32 | +# steps: |
| 33 | +# - uses: actions/checkout@v3 |
| 34 | +# with: |
| 35 | +# lfs: true |
| 36 | +# - uses: actions/cache@v3 |
| 37 | +# with: |
| 38 | +# path: Library |
| 39 | +# key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }} |
| 40 | +# restore-keys: | |
| 41 | +# Library-${{ matrix.targetPlatform }} |
| 42 | +# Library- |
| 43 | +# - name: Build project |
| 44 | +# uses: game-ci/unity-builder@v4 |
| 45 | +# env: |
| 46 | +# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} |
| 47 | +# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} |
| 48 | +# UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} |
| 49 | +# with: |
| 50 | +# targetPlatform: ${{ matrix.targetPlatform }} |
| 51 | +# projectPath: sample |
| 52 | +# buildMethod: ${{ matrix.buildMethod }} |
| 53 | +# customParameters: -logFile logFile.log -quit -batchmode |
| 54 | +# - name: List build directory |
| 55 | +# run: ls -R ./ |
| 56 | +# - name: Upload artifact |
| 57 | +# uses: actions/upload-artifact@v4 |
| 58 | +# if: always() |
| 59 | +# with: |
| 60 | +# name: Build-${{ matrix.targetPlatform }} |
| 61 | +# path: ${{ matrix.buildPath }} |
| 62 | +# test: |
| 63 | +# name: Run ${{ matrix.targetPlatform }} UI tests 🧪 |
| 64 | +# needs: build |
| 65 | +# strategy: |
| 66 | +# matrix: |
| 67 | +# include: |
| 68 | +# - targetPlatform: StandaloneOSX |
| 69 | +# runs-on: [self-hosted, macOS] |
| 70 | +# test_script: pytest -xs test/test_mac.py::MacTest |
| 71 | +# - targetPlatform: StandaloneWindows64 |
| 72 | +# runs-on: [self-hosted, windows] |
| 73 | +# test_script: pytest -xs test/test_windows.py::WindowsTest |
| 74 | +# - targetPlatform: Android |
| 75 | +# runs-on: [ self-hosted, macOS ] |
| 76 | +# test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml" |
| 77 | +# concurrency: |
| 78 | +# group: test-${{ matrix.targetPlatform }} |
| 79 | +# runs-on: ${{ matrix.runs-on }} |
| 80 | +# steps: |
| 81 | +# - uses: actions/checkout@v3 |
| 82 | +# with: |
| 83 | +# lfs: true |
| 84 | +# - uses: actions/download-artifact@v4 |
| 85 | +# with: |
| 86 | +# name: Build-${{ matrix.targetPlatform }} |
| 87 | +# path: sample/Tests |
| 88 | +# - name: Make macOS artifact executable |
| 89 | +# if: ${{ matrix.targetPlatform == 'StandaloneOSX' }} |
| 90 | +# run: chmod +x sample/Tests/SampleApp.app/Contents/MacOS/* |
| 91 | +# - uses: actions/setup-python@v4 |
| 92 | +# with: |
| 93 | +# python-version: "3.10" |
| 94 | +# - name: Install dependencies (Windows) |
| 95 | +# if: ${{ matrix.targetPlatform == 'StandaloneWindows64' }} |
| 96 | +# run: pip install -r "sample/Tests/requirements-desktop.txt" |
| 97 | +# - name: Install dependencies (Mac) |
| 98 | +# if: ${{ matrix.targetPlatform != 'StandaloneWindows64' }} |
| 99 | +# run: | |
| 100 | +# if [[ "${{ matrix.targetPlatform }}" == "StandaloneOSX" ]]; then |
| 101 | +# pip uninstall -y browserstack-sdk || true |
| 102 | +# pip install -r "sample/Tests/requirements-desktop.txt" |
| 103 | +# else |
| 104 | +# pip install -r "sample/Tests/requirements-mobile.txt" |
| 105 | +# fi |
| 106 | +# - name: Run UI tests |
| 107 | +# env: |
| 108 | +# UNITY_APP_PATH: SampleApp.app |
| 109 | +# UNITY_APP_NAME: SampleApp |
| 110 | +# MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }} |
| 111 | +# BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
| 112 | +# BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 113 | +# working-directory: sample/Tests |
| 114 | +# run: ${{ matrix.test_script }} |
| 115 | +# test-ios: |
| 116 | +# name: Run iOS UI tests 🧪 |
| 117 | +# runs-on: [ self-hosted, macOS ] |
| 118 | +# steps: |
| 119 | +# - uses: actions/checkout@v3 |
| 120 | +# with: |
| 121 | +# lfs: true |
| 122 | +# - name: Build iOS app |
| 123 | +# working-directory: sample |
| 124 | +# run: ./build_ios.sh |
| 125 | +# - uses: actions/setup-python@v4 |
| 126 | +# with: |
| 127 | +# python-version: "3.10" |
| 128 | +# - name: Install dependencies |
| 129 | +# run: pip install -r "sample/Tests/requirements-mobile.txt" |
| 130 | +# - name: Run UI tests |
| 131 | +# env: |
| 132 | +# MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }} |
| 133 | +# BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
| 134 | +# BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 135 | +# working-directory: sample/Tests |
| 136 | +# run: browserstack-sdk pytest -s ./test/test_ios.py --browserstack.config "browserstack.ios.yml" |
118 | 137 |
|
0 commit comments