forked from mosa/MOSA-Project
-
Notifications
You must be signed in to change notification settings - Fork 4
372 lines (357 loc) · 14.8 KB
/
builds.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
name: Builds
on:
push:
pull_request:
permissions:
contents: write
env:
BUILD_VERSION: 2.5.0.${{ github.run_number }}
jobs:
windows-build:
name: Windows Build
runs-on: windows-latest
timeout-minutes: 15
env:
NUGET_ENABLE_LEGACY_CSPROJ_PACK: true
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Setup Nuget.exe
uses: nuget/setup-nuget@v1
- name: Restore nuget Packages
run: dotnet restore Source/Mosa.sln
- name: Build
run: dotnet build Source/Mosa.sln /p:Version=${{ env.BUILD_VERSION }}
- name: Unit Test
run: dotnet test Source/Mosa.sln
- name: Cleanup
run: cmd.exe /C "rmdir /s /q bin\reko bin\cs bin\de bin\es bin\fr bin\it bin\ja bin\ko bin\pl bin\pt-BR bin\ru bin\tr bin\zh-Hans bin\zh-Hant"
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
name: windows-build-artifact
path: bin
- name: Create Package - Mosa.Tools.Package
run: nuget pack Source\Mosa.Packages\Mosa.Tools.Package.nuspec -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.Tools.Package.Qemu
run: nuget pack Source\Mosa.Packages\Mosa.Tools.Package.Qemu.nuspec -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.Platform
run: nuget pack Source\Mosa.Packages\Mosa.Platform.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.Platform.x86
run: nuget pack Source\Mosa.Packages\Mosa.Platform.x86.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.DeviceSystem
run: nuget pack Source\Mosa.Packages\Mosa.DeviceSystem.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Build Project - Mosa.Templates
run: dotnet build Source\Mosa.Templates\Mosa.Templates.csproj
- name: Create Package - Mosa.Templates
run: nuget pack Source\Mosa.Templates\Mosa.Templates.csproj -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Store Nuget Packages Artifact
uses: actions/upload-artifact@v3
with:
name: Nuget Packages
path: bin\nupkg
windows-build-packaging:
name: Windows Build Packaging
needs: [windows-build, linux-build, macos-build, generate-docs, windows-unit-testing, linux-unit-testing, macos-unit-testing, windows-demo-testing, linux-demo-testing, macos-demo-testing]
runs-on: windows-latest
timeout-minutes: 15
if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master'
env:
NUGET_ENABLE_LEGACY_CSPROJ_PACK: true
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Nuget Packages Artifact
uses: actions/download-artifact@v3
with:
name: Nuget Packages
path: bin\nupkg
- name: Publish Package - Mosa.Tools.Package
run: dotnet nuget push bin\nupkg\Mosa.Tools.Package.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Tools.Package.Qemu
run: dotnet nuget push bin\nupkg\Mosa.Tools.Package.Qemu.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Platform
run: dotnet nuget push bin\nupkg\Mosa.Platform.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Platform.x86
run: dotnet nuget push bin\nupkg\Mosa.Platform.x86.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.DeviceSystem
run: dotnet nuget push bin\nupkg\Mosa.DeviceSystem.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Templates
run: dotnet nuget push bin\nupkg\Mosa.Templates.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
linux-build:
name: Linux Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore nuget Packages
run: dotnet restore Source/Mosa.Linux.sln
- name: Build
run: dotnet build Source/Mosa.Linux.sln
- name: Unit Test
run: dotnet test Source/Mosa.Linux.sln
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
name: linux-build-artifact
path: bin
macos-build:
name: MacOS Build
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore nuget Packages
run: dotnet restore Source/Mosa.Linux.sln
- name: Build
run: dotnet build Source/Mosa.Linux.sln
- name: Unit Test
run: dotnet test Source/Mosa.Linux.sln
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
name: macos-build-artifact
path: bin
generate-docs:
name: Generate Documentation
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master'
steps:
- name: Set python3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update package repository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Graphviz
run: sudo apt-get install -y graphviz
- name: Install Sphinx dependencies
run: pip3 install sphinx sphinxcontrib.httpdomain sphinx-prompt sphinx_rtd_theme sphinx-tabs
- name: Generate HTML website
run: sphinx-build -b html Source/Docs sphinx-docs
- name: Copy CNAME file
run: cp Source/Docs/CNAME sphinx-docs/
- name: Copy .nojekyll file
run: cp Source/Docs/.nojekyll sphinx-docs/
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: sphinx-docs
branch: docs
windows-unit-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Windows - Unit Test -o${{ matrix.optimization }}
runs-on: windows-latest
timeout-minutes: 15
needs: windows-build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: windows-build-artifact
path: bin
- name: Unit Test
run: bin\Mosa.Utility.UnitTests.exe -check -o${{ matrix.optimization }}
linux-unit-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Linux - Unit Test -o${{ matrix.optimization }}
runs-on: ubuntu-latest
timeout-minutes: 15
needs: linux-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: linux-build-artifact
path: bin
- name: Update Package Respository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Qemu and Dependencies
run: sudo apt-get -y -o Acquire::Retries=5 install qemu-system-x86
- name: Unit Test
run: dotnet bin/Mosa.Utility.UnitTests.dll -check -o${{ matrix.optimization }}
macos-unit-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: MacOS - Unit Test -o${{ matrix.optimization }}
runs-on: macos-latest
timeout-minutes: 15
needs: macos-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: macos-build-artifact
path: bin
- name: Unit Test
run: dotnet bin/Mosa.Utility.UnitTests.dll -check -o${{ matrix.optimization }}
windows-demo-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Windows - Demo Test -o${{ matrix.optimization }}
runs-on: windows-latest
timeout-minutes: 15
needs: windows-build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: windows-build-artifact
path: bin
- name: Demo Test - BareMetal Starter
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.Starter.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal TestWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.TestWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal HelloWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal CoolWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin\Include
linux-demo-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Linux - Demo Test -o${{ matrix.optimization }}
runs-on: ubuntu-latest
timeout-minutes: 15
needs: linux-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: linux-build-artifact
path: bin
- name: Update Package Respository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Qemu and Dependencies
run: sudo apt-get -y -o Acquire::Retries=5 install qemu-system-x86
- name: Demo Test - BareMetal Starter
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.Starter.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal TestWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal HelloWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin/Include
macos-demo-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: MacOS - Demo Test -o${{ matrix.optimization }}
runs-on: macos-latest
timeout-minutes: 15
needs: macos-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: macos-build-artifact
path: bin
- name: Demo Test - BareMetal Starter
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.Starter.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal TestWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.TestWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal HelloWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test -output-counters
- name: Demo Test - BareMetal CoolWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.CoolWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin/Include