@@ -12,125 +12,125 @@ concurrency:
12
12
cancel-in-progress : true
13
13
14
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
- # - targetPlatform: StandaloneWindows64
26
- # buildMethod: WindowsBuilder.BuildForAltTester
27
- # buildPath: sample/Builds/Windows64
28
- # - targetPlatform: Android
29
- # buildMethod: MobileBuilder.BuildForAltTester
30
- # buildPath: sample/Builds/Android
31
- # steps:
32
- # - uses: actions/checkout@v3
33
- # with:
34
- # lfs: true
35
- # - uses: actions/cache@v3
36
- # with:
37
- # path: Library
38
- # key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }}
39
- # restore-keys: |
40
- # Library-${{ matrix.targetPlatform }}
41
- # Library-
42
- # - name: Build project
43
- # uses: game-ci/unity-builder@v4
44
- # env:
45
- # UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
46
- # UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
47
- # UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
48
- # with:
49
- # targetPlatform: ${{ matrix.targetPlatform }}
50
- # projectPath: sample
51
- # buildMethod: ${{ matrix.buildMethod }}
52
- # customParameters: -logFile logFile.log -quit -batchmode
53
- # artifactsPath: ${{ matrix.buildPath }}
54
- # - name: List build directory
55
- # run: ls -R ./
56
- # - name: Ensure build path exists
57
- # run: mkdir -p ${{ matrix.buildPath }}
58
- # - name: Upload artifact
59
- # uses: actions/upload-artifact@v4
60
- # if: always()
61
- # with:
62
- # name: Build-${{ matrix.targetPlatform }}
63
- # path: ${{ matrix.buildPath }}
64
- # test:
65
- # name: Run ${{ matrix.targetPlatform }} UI tests 🧪
66
- # needs: build
67
- # strategy:
68
- # matrix:
69
- # include:
70
- # - targetPlatform: StandaloneOSX
71
- # runs-on: [self-hosted, macOS]
72
- # test_script: pytest -xs test/test_mac.py::MacTest
73
- # - targetPlatform: StandaloneWindows64
74
- # runs-on: [self-hosted, windows]
75
- # test_script: pytest -xs test/test_windows.py::WindowsTest
76
- # - targetPlatform: Android
77
- # runs-on: [ self-hosted, macOS ]
78
- # test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
79
- # concurrency:
80
- # group: test-${{ matrix.targetPlatform }}
81
- # runs-on: ${{ matrix.runs-on }}
82
- # steps:
83
- # - uses: actions/checkout@v3
84
- # with:
85
- # lfs: true
86
- # - name: Create temporary keychain
87
- # if: ${{ matrix.targetPlatform == 'StandaloneOSX' }}
88
- # run: |
89
- # security list-keychains
90
- # security delete-keychain temporary || true
91
- # security list-keychains
92
- # security create-keychain -p "" temporary
93
- # security default-keychain -s temporary
94
- # security unlock-keychain -p "" temporary
95
- # security set-keychain-settings -lut 600 temporary
96
- # - uses: actions/download-artifact@v4
97
- # with:
98
- # name: Build-${{ matrix.targetPlatform }}
99
- # path: sample/Tests
100
- # - name: Make macOS artifact executable
101
- # if: ${{ matrix.targetPlatform == 'StandaloneOSX' }}
102
- # run: chmod +x sample/Tests/SampleApp.app/Contents/MacOS/*
103
- # - uses: actions/setup-python@v4
104
- # with:
105
- # python-version: "3.10"
106
- # - name: Install dependencies (Windows)
107
- # if: ${{ matrix.targetPlatform == 'StandaloneWindows64' }}
108
- # run: pip install -r "sample/Tests/requirements-desktop.txt"
109
- # - name: Install dependencies (Mac)
110
- # if: ${{ matrix.targetPlatform != 'StandaloneWindows64' }}
111
- # run: |
112
- # if [[ "${{ matrix.targetPlatform }}" == "StandaloneOSX" ]]; then
113
- # pip uninstall -y browserstack-sdk || true
114
- # pip install -r "sample/Tests/requirements-desktop.txt"
115
- # else
116
- # pip install -r "sample/Tests/requirements-mobile.txt"
117
- # fi
118
- # - name: Run UI tests
119
- # env:
120
- # UNITY_APP_PATH: SampleApp.app
121
- # UNITY_APP_NAME: SampleApp
122
- # MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
123
- # BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
124
- # BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
125
- # working-directory: sample/Tests
126
- # run: ${{ matrix.test_script }}
127
- # - name: Remove temporary keychain
128
- # if: ${{ matrix.targetPlatform == 'StandaloneOSX' }}
129
- # run: |
130
- # security list-keychains
131
- # security default-keychain -s ~/Library/Keychains/login.keychain-db
132
- # security delete-keychain temporary
133
- # security list-keychains
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
+ - targetPlatform : StandaloneWindows64
26
+ buildMethod : WindowsBuilder.BuildForAltTester
27
+ buildPath : sample/Builds/Windows64
28
+ - targetPlatform : Android
29
+ buildMethod : MobileBuilder.BuildForAltTester
30
+ buildPath : sample/Builds/Android
31
+ steps :
32
+ - uses : actions/checkout@v3
33
+ with :
34
+ lfs : true
35
+ - uses : actions/cache@v3
36
+ with :
37
+ path : Library
38
+ key : Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }}
39
+ restore-keys : |
40
+ Library-${{ matrix.targetPlatform }}
41
+ Library-
42
+ - name : Build project
43
+ uses : game-ci/unity-builder@v4
44
+ env :
45
+ UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
46
+ UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
47
+ UNITY_SERIAL : ${{ secrets.UNITY_SERIAL }}
48
+ with :
49
+ targetPlatform : ${{ matrix.targetPlatform }}
50
+ projectPath : sample
51
+ buildMethod : ${{ matrix.buildMethod }}
52
+ customParameters : -logFile logFile.log -quit -batchmode
53
+ artifactsPath : ${{ matrix.buildPath }}
54
+ - name : List build directory
55
+ run : ls -R ./
56
+ - name : Ensure build path exists
57
+ run : mkdir -p ${{ matrix.buildPath }}
58
+ - name : Upload artifact
59
+ uses : actions/upload-artifact@v4
60
+ if : always()
61
+ with :
62
+ name : Build-${{ matrix.targetPlatform }}
63
+ path : ${{ matrix.buildPath }}
64
+ test :
65
+ name : Run ${{ matrix.targetPlatform }} UI tests 🧪
66
+ needs : build
67
+ strategy :
68
+ matrix :
69
+ include :
70
+ - targetPlatform : StandaloneOSX
71
+ runs-on : [self-hosted, macOS]
72
+ test_script : pytest -xs test/test_mac.py::MacTest
73
+ - targetPlatform : StandaloneWindows64
74
+ runs-on : [self-hosted, windows]
75
+ test_script : pytest -xs test/test_windows.py::WindowsTest
76
+ - targetPlatform : Android
77
+ runs-on : [ self-hosted, macOS ]
78
+ test_script : browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
79
+ concurrency :
80
+ group : test-${{ matrix.targetPlatform }}
81
+ runs-on : ${{ matrix.runs-on }}
82
+ steps :
83
+ - uses : actions/checkout@v3
84
+ with :
85
+ lfs : true
86
+ - name : Create temporary keychain
87
+ if : ${{ matrix.targetPlatform == 'StandaloneOSX' }}
88
+ run : |
89
+ security list-keychains
90
+ security delete-keychain temporary || true
91
+ security list-keychains
92
+ security create-keychain -p "" temporary
93
+ security default-keychain -s temporary
94
+ security unlock-keychain -p "" temporary
95
+ security set-keychain-settings -lut 600 temporary
96
+ - uses : actions/download-artifact@v4
97
+ with :
98
+ name : Build-${{ matrix.targetPlatform }}
99
+ path : sample/Tests
100
+ - name : Make macOS artifact executable
101
+ if : ${{ matrix.targetPlatform == 'StandaloneOSX' }}
102
+ run : chmod +x sample/Tests/SampleApp.app/Contents/MacOS/*
103
+ - uses : actions/setup-python@v4
104
+ with :
105
+ python-version : " 3.10"
106
+ - name : Install dependencies (Windows)
107
+ if : ${{ matrix.targetPlatform == 'StandaloneWindows64' }}
108
+ run : pip install -r "sample/Tests/requirements-desktop.txt"
109
+ - name : Install dependencies (Mac)
110
+ if : ${{ matrix.targetPlatform != 'StandaloneWindows64' }}
111
+ run : |
112
+ if [[ "${{ matrix.targetPlatform }}" == "StandaloneOSX" ]]; then
113
+ pip uninstall -y browserstack-sdk || true
114
+ pip install -r "sample/Tests/requirements-desktop.txt"
115
+ else
116
+ pip install -r "sample/Tests/requirements-mobile.txt"
117
+ fi
118
+ - name : Run UI tests
119
+ env :
120
+ UNITY_APP_PATH : SampleApp.app
121
+ UNITY_APP_NAME : SampleApp
122
+ MAILSLURP_API_KEY : ${{ secrets.MAILSLURP_API_KEY }}
123
+ BROWSERSTACK_USERNAME : ${{ secrets.BROWSERSTACK_USERNAME }}
124
+ BROWSERSTACK_ACCESS_KEY : ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
125
+ working-directory : sample/Tests
126
+ run : ${{ matrix.test_script }}
127
+ - name : Remove temporary keychain
128
+ if : ${{ matrix.targetPlatform == 'StandaloneOSX' }}
129
+ run : |
130
+ security list-keychains
131
+ security default-keychain -s ~/Library/Keychains/login.keychain-db
132
+ security delete-keychain temporary
133
+ security list-keychains
134
134
test-ios :
135
135
name : Run iOS UI tests 🧪
136
136
runs-on : [ self-hosted, macOS ]
0 commit comments