forked from modesttree/Zenject
-
Notifications
You must be signed in to change notification settings - Fork 96
167 lines (139 loc) · 4.84 KB
/
ci.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
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
163
164
165
166
167
name: CI
on:
push:
branches:
- master
paths-ignore:
- '*.md'
- 'README.md'
workflow_dispatch: {}
jobs:
buildAndTestForSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- UnityProject
assetsPath:
- UnityProject
unityVersion:
- 2019.4.1f1
targetPlatform:
- Android # Build a Android standalone.
- iOS # Build an iOS player.
- StandaloneLinux64 # Build a Linux 64-bit standalone.
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- WebGL # WebGL.
# Not supported platforms by GitHub actions:
# - Windows Store # Build a standalone for Windows Store devices.
# - PS4 # Build a Playstation 4 standalone.
testMode:
# - playmode
- editmode
steps:
# Need to be rootless to have write access for checkout and clone repo
- name: Use container in rootless mode
uses: ScribeMD/[email protected]
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Create Empty Unity project
- name: Create Unity Project
uses: jbltx/[email protected]
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
unityVersion: ${{ matrix.unityVersion }}
projectPath: ${{ matrix.projectPath }}
# Checkout and clone UniDi into Assets
# There's no need to do complicated stuff like managing the project manifest
# We just clone to the Assets folder as tests will run from here.
# If there's another way in the future (like automating the process with a cmd for
# Unity's Package Manager) then that would be cool to implement in the Ci workflow.
- name: Checkout and Clone Repository
uses: actions/checkout@v2
with:
repository: Mathijs-Bakker/Extenject
path: ${{ matrix.projectPath }}
# Cache
- name: Caching Unity Project Library
uses: actions/cache@v2
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ hashFiles(matrix.projectPath) }}
restore-keys: |
Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-
Library-${{ matrix.projectPath }}-
Library-
# Test Runner
- name: Run Tests
uses: game-ci/unity-test-runner@v2
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: ${{ matrix.testMode }}
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: ${{ matrix.testMode }} Test Results
# Upload Test Artifacts
- name: Upload Test Results Artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: Test results for ${{ matrix.testMode }}
path: ${{ steps.testRunner.outputs.artifactsPath }}
# Build
- name: Build
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
# Allow Dirty Build as the semantic versioning is doing unsuspecting things
# this could be something to look further into
allowDirtyBuild: true
build-Zenject-Usage:
runs-on: ubuntu-latest
name: Build Zenject-Usage
env:
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Build
run: dotnet build AssemblyBuild\Zenject-usage.sln
- name: Upload dll
uses: actions/upload-artifact@v1
with:
name: Zenject-Usage
path: AssemblyBuild/Zenject-Usage/Zenject-Usage/bin/Debug/netcoreapp3.1/Zenject-Usage.dll
deployBuild:
name: Deploy Build Zenject-Usage
runs-on: ubuntu-latest
needs: build-Zenject-Usage
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Zenject-Usage
uses: actions/download-artifact@v1
with:
name: UniDi-Usage
- name: Install Zenject-Usage
run: |
ls -l Zenject-Usage
cp Zeenject-Usage/Zenject-Usage.dll Source/Usage
ls -l Source/Usage