forked from Bareflank/MicroV
-
Notifications
You must be signed in to change notification settings - Fork 1
350 lines (309 loc) · 12.3 KB
/
microv.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
name: CI Tests for MicroV
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
schedule:
- cron: '0 3 * * 5' # Every Friday at 3am
jobs:
clang-format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y python clang clang-format cmake
shell: bash
- name: Validate Source Formatting
run: |
mkdir build && cd build
cp ../microv/scripts/cmake/config/config.cmake ..
echo 'set(ENABLE_BUILD_VMM OFF)' >> ../config.cmake
echo 'set(BUILD_XEN OFF)' >> ../config.cmake
echo 'set(BUILD_BUILDER OFF)' >> ../config.cmake
echo 'set(ENABLE_CLANG_FORMAT ON)' >> ../config.cmake
cmake ../microv/deps/hypervisor -DCONFIG=../config.cmake
make clang-format
cd ../microv
if [[ -n $(git diff) ]]; then
echo "You must run make clang-format before submitting a pull request"
echo ""
git diff
exit -1
fi
shell: bash
build-efi:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y python build-essential linux-headers-$(uname -r) nasm clang cmake libelf-dev
shell: bash
- name: Build EFI
run: |
mkdir build && cd build
cp ../microv/scripts/cmake/config/config.cmake ..
echo 'set(ENABLE_BUILD_USERSPACE OFF)' >> ../config.cmake
echo 'set(ENABLE_BUILD_VMM ON)' >> ../config.cmake
echo 'set(ENABLE_BUILD_EFI ON)' >> ../config.cmake
echo 'set(XEN_REGISTER_BASED_ABI ON)' >> ../config.cmake
echo 'set(ENABLE_SERIAL OFF)' >> ../config.cmake
cmake ../microv/deps/hypervisor -DCONFIG=../config.cmake -DCMAKE_CXX_FLAGS="--verbose "
make
shell: bash
- uses: actions/upload-artifact@v2
with:
name: microv_efi
path: |
build/prefixes/x86_64-efi-pe/bin/bareflank.efi
build-efi-with-readconsole:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y python build-essential linux-headers-$(uname -r) nasm clang cmake libelf-dev
shell: bash
- name: Build EFI with Xen readconsole
run: |
mkdir build && cd build
cp ../microv/scripts/cmake/config/config.cmake ..
echo 'set(ENABLE_BUILD_USERSPACE OFF)' >> ../config.cmake
echo 'set(ENABLE_BUILD_VMM ON)' >> ../config.cmake
echo 'set(ENABLE_BUILD_EFI ON)' >> ../config.cmake
echo 'set(XEN_REGISTER_BASED_ABI ON)' >> ../config.cmake
echo 'set(ENABLE_SERIAL OFF)' >> ../config.cmake
echo 'set(XEN_READCONSOLE_ROOTVM ON)' >> ../config.cmake
cmake ../microv/deps/hypervisor -DCONFIG=../config.cmake -DCMAKE_CXX_FLAGS="--verbose "
make
shell: bash
- uses: actions/upload-artifact@v2
with:
name: microv_efi_xen_readconsole
path: |
build/prefixes/x86_64-efi-pe/bin/bareflank.efi
build-efi-debug:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y python build-essential linux-headers-$(uname -r) nasm clang cmake libelf-dev
shell: bash
- name: Build EFI
run: |
mkdir build && cd build
cp ../microv/scripts/cmake/config/config.cmake ..
echo 'set(ENABLE_BUILD_USERSPACE OFF)' >> ../config.cmake
echo 'set(ENABLE_BUILD_VMM ON)' >> ../config.cmake
echo 'set(ENABLE_BUILD_EFI ON)' >> ../config.cmake
echo 'set(XEN_REGISTER_BASED_ABI ON)' >> ../config.cmake
echo 'set(XEN_READCONSOLE_ROOTVM ON)' >> ../config.cmake
echo 'set(USE_XUE ON)' >> ../config.cmake
echo 'set(ENABLE_SERIAL ON)' >> ../config.cmake
echo 'set(DEFAULT_COM_PORT 0x3F8U)' >> ../config.cmake
echo 'set(DEBUG_LEVEL 9)' >> ../config.cmake
cmake ../microv/deps/hypervisor -DCONFIG=../config.cmake -DCMAKE_CXX_FLAGS="--verbose "
make -j
shell: bash
- uses: actions/upload-artifact@v2
with:
name: microv_efi_debug
path: |
build/prefixes/x86_64-efi-pe/bin/bareflank.efi
build-efi-noeth:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup
run: |
sudo apt-get update
sudo apt-get install -y python build-essential linux-headers-$(uname -r) nasm clang cmake libelf-dev
shell: bash
- name: Build EFI
run: |
mkdir build && cd build
cp ../microv/scripts/cmake/config/config.cmake ..
echo 'set(ENABLE_BUILD_USERSPACE OFF)' >> ../config.cmake
echo 'set(ENABLE_BUILD_VMM ON)' >> ../config.cmake
echo 'set(ENABLE_BUILD_EFI ON)' >> ../config.cmake
echo 'set(XEN_REGISTER_BASED_ABI ON)' >> ../config.cmake
echo 'set(ENABLE_NOETH_PT ON)' >> ../config.cmake
echo 'set(ENABLE_SERIAL OFF)' >> ../config.cmake
cmake ../microv/deps/hypervisor -DCONFIG=../config.cmake -DCMAKE_CXX_FLAGS="--verbose "
make
shell: bash
- uses: actions/upload-artifact@v2
with:
name: microv_efi_noeth
path: |
build/prefixes/x86_64-efi-pe/bin/bareflank.efi
build-userpace:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup MSBuild (PATH)
id: setup_msbuild_path
uses: microsoft/[email protected]
- name: Setup
run: |
$MSBUILD_PATH = "${{steps.setup_msbuild_path.outputs.msbuildPath}}"
echo msbuild path: $MSBUILD_PATH
echo $MSBUILD_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: pwsh
- name: Build Userspace
run: |
mkdir build && cd build
cp ..\microv\scripts\cmake\config\config.cmake ..
Add-Content -Path ..\config.cmake -Value "set(ENABLE_BUILD_USERSPACE ON)"
Add-Content -Path ..\config.cmake -Value "set(ENABLE_BUILD_VMM OFF)"
Add-Content -Path ..\config.cmake -Value "set(UVCTL_WINDOWS_SERVICE_FORCE_BOOTENTRY ON)"
cmake ../microv/deps/hypervisor -DCONFIG=..\config.cmake -G "Visual Studio 16 2019" -A x64
& msbuild /p:Configuration=Release /p:Platform=x64 /p:TargetVersion=Windows10 hypervisor.sln
shell: pwsh
- uses: actions/upload-artifact@v2
with:
name: microv_userspace
path: |
build/prefixes/x86_64-userspace-pe/bin/uvctl.exe
build-userpace-debug:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup MSBuild (PATH)
id: setup_msbuild_path
uses: microsoft/[email protected]
- name: Setup
run: |
$MSBUILD_PATH = "${{steps.setup_msbuild_path.outputs.msbuildPath}}"
echo msbuild path: $MSBUILD_PATH
echo $MSBUILD_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: pwsh
- name: Build Userspace
run: |
mkdir build && cd build
cp ..\microv\scripts\cmake\config\config.cmake ..
Add-Content -Path ..\config.cmake -Value "set(ENABLE_BUILD_USERSPACE ON)"
Add-Content -Path ..\config.cmake -Value "set(ENABLE_BUILD_VMM OFF)"
Add-Content -Path ..\config.cmake -Value "set(XEN_READCONSOLE_ROOTVM ON)"
cmake ../microv/deps/hypervisor -DCONFIG=..\config.cmake -G "Visual Studio 16 2019" -A x64
& msbuild /p:Configuration=Release /p:Platform=x64 /p:TargetVersion=Windows10 hypervisor.sln
shell: pwsh
- uses: actions/upload-artifact@v2
with:
name: microv_userspace_debug
path: |
build/prefixes/x86_64-userspace-pe/bin/uvctl.exe
build-drivers:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup MSBuild (PATH)
id: setup_msbuild_path
uses: microsoft/[email protected]
- name: Setup
run: |
# Get dependencies
$MSBUILD_PATH = "${{steps.setup_msbuild_path.outputs.msbuildPath}}"
echo "msbuild path: $MSBUILD_PATH"
echo $MSBUILD_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Set latest build number
$runs = Invoke-WebRequest -Headers @{"Authorization" = 'token ${{ secrets.GITHUB_TOKEN }}'} -Uri 'https://api.github.com/repos/bareflank/microv/actions/runs?branch=mono&status=success' | ConvertFrom-Json
Add-Content -Path $Env:GITHUB_ENV -Value "BUILD_NUMBER=$($runs.total_count + 10)"
shell: pwsh
- name: Build Drivers
run: |
cd .\microv\drivers
.\build-all.ps1 -RegisterBasedAbi
shell: pwsh
- uses: actions/upload-artifact@v2
with:
name: microv_drivers
path: |
microv/drivers/builder/windows/builder/x64/*
microv/drivers/builder/windows/vs2019/Windows10Release/x64/builder.cer
microv/drivers/visr/windows/visr/x64/*
microv/drivers/visr/windows/vs2019/Windows10Release/x64/visr.cer
microv/drivers/winpv/xenbus/xenbus/x64/*
microv/drivers/winpv/xenbus/vs2019/Windows10Release/x64/xenbus.cer
microv/drivers/winpv/xennet/xennet/x64/*
microv/drivers/winpv/xennet/vs2019/Windows10Release/x64/xennet.cer
microv/drivers/winpv/xenvif/xenvif/x64/*
microv/drivers/winpv/xenvif/vs2019/Windows10Release/x64/xenvif.cer
microv/drivers/winpv/xeniface/xeniface/x64/*
microv/drivers/winpv/xeniface/vs2019/Windows10Release/x64/xeniface.cer
microv/drivers/winpv/xeniface/include/xencontrol.h
microv/drivers/winpv/xeniface/include/xeniface_ioctls.h
build-drivers-nocerts:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
path: microv
- name: Setup MSBuild (PATH)
id: setup_msbuild_path
uses: microsoft/[email protected]
- name: Setup
run: |
# Get dependencies
$MSBUILD_PATH = "${{steps.setup_msbuild_path.outputs.msbuildPath}}"
echo "msbuild path: $MSBUILD_PATH"
echo $MSBUILD_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Set latest build number
$runs = Invoke-WebRequest -Headers @{"Authorization" = 'token ${{ secrets.GITHUB_TOKEN }}'} -Uri 'https://api.github.com/repos/bareflank/microv/actions/runs?branch=mono&status=success' | ConvertFrom-Json
Add-Content -Path $Env:GITHUB_ENV -Value "BUILD_NUMBER=$($runs.total_count + 10)"
shell: pwsh
- name: Build Drivers with Test Sign Off
run: |
cd .\microv\drivers
$SignOff = '<SignMode>Off</SignMode>'
$SignTest = '<SignMode>TestSign</SignMode>'
$Files = Get-ChildItem -Recurse | Select-String $SignTest -List
foreach ($f in $Files.Path) { (Get-Content $f) -replace $SignTest, $SignOff | Set-Content $f }
.\build-all.ps1 -RegisterBasedAbi
shell: pwsh
- uses: actions/upload-artifact@v2
with:
name: microv_drivers_nocerts
path: |
microv/drivers/builder/windows/vs2019/Windows10Release/x64/package/*
microv/drivers/visr/windows/vs2019/Windows10Release/x64/package/*
microv/drivers/winpv/xenbus/vs2019/Windows10Release/x64/package/*
microv/drivers/winpv/xennet/vs2019/Windows10Release/x64/package/*
microv/drivers/winpv/xenvif/vs2019/Windows10Release/x64/package/*
microv/drivers/winpv/xeniface/vs2019/Windows10Release/x64/package/*
microv/drivers/winpv/xeniface/include/xencontrol.h
microv/drivers/winpv/xeniface/include/xeniface_ioctls.h