-
Notifications
You must be signed in to change notification settings - Fork 36
285 lines (276 loc) · 9.49 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: CI
on:
push:
branches:
- master
- develop
- housekeeping
pull_request:
branches:
- master
- develop
- housekeeping
workflow_dispatch:
jobs:
lint:
runs-on: windows-latest
name: Linting
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
steps:
- uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: dotnet restore solution
run: dotnet restore Fusee.sln
- name: dotnet format solution
run: dotnet format style Fusee.sln
- name: Commiting changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Linting
tests:
name: Tests
needs: [lint]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
strategy:
fail-fast: false
matrix:
os: [ 'windows-latest', 'ubuntu-latest', 'macos-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: AssetStorage
run: dotnet test -c Release src/Tests/AssetStorage/Desktop/Fusee.Tests.AssetStorage.Desktop.csproj
- name: Math
run: dotnet test -c Release src/Tests/Math/Core/Fusee.Tests.Math.Core.csproj
- name: Scene Components
run: dotnet test -c Release src/Tests/Scene/Components/Fusee.Tests.Scene.Components.csproj
- name: Serialization V1
run: dotnet test -c Release src/Tests/Serialization/V1/Fusee.Tests.Serialization.V1.csproj
- name: Xene
run: dotnet test -c Release src/Tests/Xene/Fusee.Tests.Xene.csproj
- name: Xirkit
run: dotnet test -c Release src/Tests/Xirkit/Core/Fusee.Tests.Xirkit.Core.csproj
- name: Xirkit Nested Access
run: dotnet test -c Release src/Tests/Xirkit/NestedAccess/Fusee.Tests.Xirkit.NestedAccess.csproj
rendertests:
name: Render Tests
needs: [lint]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
strategy:
fail-fast: false
matrix:
os: [ 'windows-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Render image compare
run: dotnet run -c Release --project src/Tests/Render/Desktop/Fusee.Tests.Render.Desktop.csproj
- name: Upload artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: Rendertests
path: |
bin/Release/Tests/Render/Desktop/net8.0/*.png
bin/Release/Tests/Render/Desktop/net8.0/References/*.png
builddesktop:
needs: [tests, rendertests]
name: Build Desktop
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
strategy:
fail-fast: false
matrix:
os: [ 'windows-latest', 'ubuntu-latest', 'macos-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build Release-Desktop
run: dotnet build -c Release-Desktop Fusee.sln
- name: Upload Player-Artifact
uses: actions/upload-artifact@v3
with:
name: fusee-desktop-${{ matrix.os }}-player
path: bin/Release/Player/Desktop/
- name: Upload Tool-Artifacts
uses: actions/upload-artifact@v3
with:
name: fusee-desktop-${{ matrix.os }}-tools
path: bin/Release/Tools/
# - name: Upload Example-Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: fusee-desktop-${{ matrix.os }}-examples
# path: bin/Release/Examples/**/Desktop/
buildnuget:
needs: [tests, rendertests]
name: Build NuGet
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
NUGET_BUILD: true
strategy:
fail-fast: false
matrix:
os: [ 'windows-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-version: '[17.9,]'
msbuild-architecture: x64
# - name: Setup dotnet macos workload
# run: dotnet workload install macos
# - name: Build Release-Blazor
# run: dotnet build -c Release-Blazor Fusee.sln
# - name: Setup wasm-tools workload
# run: dotnet workload install wasm-tools
# - name: Publish F.E.Player.Blazor
# run: dotnet publish -c Release -p:PublishProfile=FolderProfileRelease src/Engine/Player/Blazor/Fusee.Engine.Player.Blazor.csproj
# - name: Build F.T.B.Blazorpatch
# run: dotnet build -c Release src/Tools/Build/Blazorpatch/Fusee.Tools.Build.Blazorpatch.csproj
# - name: Patch Blazor
# run: dotnet bin/Release/Tools/Build/Blazorpatch/net8.0/Fusee.Tools.Build.Blazorpatch.dll -p bin/Release/Player/Blazor/net8.0/publish/wwwroot -t All
- name: Build F.E.Player.Desktop
run: dotnet publish -c Release -p:PublishProfile=win-x64-release src\Engine\Player\Desktop\Fusee.Engine.Player.Desktop.csproj
- name: Pack Fusee.sln NuGet
run: dotnet pack Fusee.sln -c Release-NuGet
- name: Pack F.B.I.Android
run: msbuild src\Base\Imp\Android\Fusee.Base.Imp.Android.csproj -t:restore,pack -p:Configuration=Release
- name: Pack F.E.I.Graphics.Android
run: msbuild src\Engine\Imp\Graphics\Android\Fusee.Engine.Imp.Graphics.Android.csproj -t:restore,pack -p:Configuration=Release
- name: Pack Core Metapackage
run: dotnet pack dis\NuGet\Core\Core.csproj -c Release -o bin\Release\nuget
- name: Pack Desktop Metapackage
run: dotnet pack dis\NuGet\Desktop\Desktop.csproj -c Release -o bin\Release\nuget
- name: Pack Android Metapackage
run: msbuild dis\NuGet\Android\Android.csproj -t:restore,pack -p:Configuration=Release
- name: Pack Fusee.Template.dotnet
run: dotnet pack dis\DnTemplate\DnTemplate.csproj -c Release -o bin\Release\nuget
- name: Pack VSTemplate
run: msbuild dis\VSTemplate\VSTemplate.sln -t:restore,build -p:Configuration=Release
- name: Pack Blender Addon
run: tar -c -a -f bin\Release\nuget\io_export_fus.zip -C bin\Release\Tools\CmdLine\net8.0\BlenderScripts\addons *
- name: Upload NuGet-Atrifacts
uses: actions/upload-artifact@v3
with:
name: fusee-nuget-${{ matrix.os }}
path: |
bin/Release/nuget/
dis/VSTemplate/VSTemplate/bin/Release/ProjectTemplates/CSharp/1033/Fusee.Template.VS.zip
dis/VSTemplate/VSIX/bin/Release/Fusee.Template.VS.Installer.vsix
buildblazor:
needs: [tests, rendertests]
name: Build Blazor
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup dotnet macos workload
run: dotnet workload install macos
- name: Build Release-Blazor
run: dotnet build -c Release-Blazor Fusee.sln
- name: Setup workloads
run: |
dotnet workload install wasm-tools
dotnet workload install wasm-tools-net7
- name: Publish F.E.Player.Blazor
run: dotnet publish -c Release -p:PublishProfile=FolderProfileRelease src/Engine/Player/Blazor/Fusee.Engine.Player.Blazor.csproj
# - name: Build F.T.B.Blazorpatch
# run: dotnet build -c Release src/Tools/Build/Blazorpatch/Fusee.Tools.Build.Blazorpatch.csproj
# - name: Patch Blazor
# run: dotnet bin/Release/Tools/Build/Blazorpatch/net8.0/Fusee.Tools.Build.Blazorpatch.dll -p bin/Release/Player/Blazor/net8.0/publish/wwwroot -t All
- name: Upload Player-Artifact
uses: actions/upload-artifact@v3
with:
name: fusee-blazor-${{ matrix.os }}-player
path: bin/Release/Player/Blazor/net8.0/publish/
buildandroid:
name: Build Android
needs: [tests, rendertests]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-version: '[17.9,]'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build with MSBuild
run: msbuild Fusee.sln -r -p:Configuration=Release-Android
codeanalysis:
name: CodeQL
needs: [builddesktop]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build Release-Desktop
run: dotnet build -c Release-Desktop Fusee.sln
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2