-
Notifications
You must be signed in to change notification settings - Fork 17
162 lines (154 loc) · 4.67 KB
/
Copy pathtest-build.yml
File metadata and controls
162 lines (154 loc) · 4.67 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
---
name: Test & Build
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: github.event.pull_request.head.repo.fork == false
name: Test sample app 🛠️
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
with:
lfs: true
- run: git lfs pull
- uses: game-ci/unity-test-runner@v4
id: passportTest
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: 2021.3.26f1
projectPath: './sample'
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: 'EditMode'
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results
path: ${{ steps.passportTest.outputs.artifactsPath }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results
path: ${{ steps.passportTest.outputs.coveragePath }}
test-unity6:
if: github.event.pull_request.head.repo.fork == false
name: Test Unity 6 sample app 🛠️
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
with:
lfs: true
- run: git lfs pull
- uses: game-ci/unity-test-runner@v4
id: unity6Test
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: 6000.0.58f2
projectPath: './sample-unity6'
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: 'EditMode'
- uses: actions/upload-artifact@v4
if: always()
with:
name: Unity6-Test-results
path: ${{ steps.unity6Test.outputs.artifactsPath }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Unity6-Coverage-results
path: ${{ steps.unity6Test.outputs.coveragePath }}
build:
needs: test
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
targetPlatform:
- iOS
- Android
- WebGL
# - StandaloneOSX
- StandaloneWindows64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key:
Library-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.targetPlatform }}
Library-
- uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: 2021.3.26f1
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: sample
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.3
if: matrix.targetPlatform == 'WebGL'
with:
branch: gh-pages
folder: build/WebGL/WebGL
- uses: actions/upload-artifact@v4
if: always()
with:
name: Build-${{ matrix.targetPlatform }}
path: build
build-unity6:
needs: test-unity6
name: Build Unity 6 for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
targetPlatform:
- iOS
# - Android
- StandaloneWindows64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key:
Library-Unity6-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-Unity6-${{ matrix.targetPlatform }}
Library-
- uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
unityVersion: 6000.0.58f2
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: sample-unity6
- uses: actions/upload-artifact@v4
if: always()
with:
name: Build-Unity6-${{ matrix.targetPlatform }}
path: build