-
Notifications
You must be signed in to change notification settings - Fork 551
165 lines (137 loc) · 5.1 KB
/
pr.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
name: Build and Test
on:
workflow_dispatch:
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: self-hosted
outputs:
testkernels: ${{ steps.testkernels_output.outputs.testkernels }}
env:
USER_KIT_PATH: 'C:\CosmosRun\'
BochsPath: 'C:\Program Files (x86)\Bochs-2.6.8\Bochs.exe'
steps:
- name: Checkout Cosmos
uses: actions/checkout@v3
with:
repository: CosmosOS/Cosmos
path: Cosmos
- name: Checkout Common
uses: actions/checkout@v3
with:
repository: CosmosOS/Common
path: Common
- name: Checkout IL2CPU
uses: actions/checkout@v3
with:
repository: CosmosOS/IL2CPU
path: IL2CPU
- name: Checkout XSharp
uses: actions/checkout@v3
with:
repository: CosmosOS/XSharp
path: XSharp
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Nuget - Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Nuget - Restore
run: |
msbuild Cosmos\Build.sln /t:Restore /maxcpucount /verbosity:normal /p:Net48=True
- name: Build - Cosmos
run: |
msbuild Cosmos\Build.sln /t:Build /maxcpucount /verbosity:normal /p:Net48=True
- name: Build - IL2CPU
run: |
dotnet publish IL2CPU\source\IL2CPU -o "$($env:USER_KIT_PATH)Build\IL2CPU\"
- name: Copy Output - Cosmos
run: |
xcopy /Y "Cosmos\source\Cosmos.Build.Tasks\tools\grub2\boot\grub\i386-pc\*.*" "$($env:USER_KIT_PATH)Build\ISO\boot\grub\i386-pc\"
xcopy /Y "Cosmos\Build\grub2\boot\grub\grub.cfg" "$($env:USER_KIT_PATH)Build\ISO\boot\grub"
xcopy /Y /S "Cosmos\Build\VMware\*" "$($env:USER_KIT_PATH)Build\VMware\"
xcopy /Y /S "Cosmos\Build\Tools" "$($env:USER_KIT_PATH)Build\Tools\"
- name: Copy Output - IL2CPU
run: |
xcopy /Y "IL2CPU\source\Cosmos.Core.DebugStub\*.xs" "$($env:USER_KIT_PATH)XSharp\DebugStub\"
# - name: Send test kernels to GITHUB_OUTPUT
# id: testkernels_output
# run: |
# $testList = dotnet test Cosmos\Tests\Cosmos.TestRunner.UnitTest\Cosmos.TestRunner.UnitTest.csproj --list-tests
# Write-Host $testList
# $testList >> tests.txt
# $match = Select-String -Pattern "^.*TestKernel\((.*)\)$" -Path tests.txt
# Write-Host $match
# $testKernels = $match.matches.groups | where { $_.index % 2 -ne 0 } | Select-Object value | foreach { $_.value }
# Write-Host $testKernels
# $testKernelsEnv = ""
# $testKernels | foreach { $testKernelsEnv += "$($_)," }
# $testKernelsEnv = $testKernelsEnv.Trim(",")
# Write-Host $testKernelsEnv
# "testkernels=[$($testKernelsEnv)]" >> $env:GITHUB_OUTPUT
test:
if: ${{ success() }}
needs: [build]
runs-on: self-hosted
strategy:
matrix:
kernel: [
"BoxingTests.Kernel",
"Cosmos.Compiler.Tests.TypeSystem.Kernel",
"Cosmos.Compiler.Tests.Bcl.Kernel",
"Cosmos.Compiler.Tests.Bcl.System.Kernel",
"Cosmos.Compiler.Tests.Exceptions.Kernel",
"Cosmos.Compiler.Tests.MethodTests.Kernel",
"Cosmos.Compiler.Tests.SingleEchoTest.Kernel",
"Cosmos.Kernel.Tests.Fat.Kernel",
"Cosmos.Kernel.Tests.IO.Kernel",
"SimpleStructsAndArraysTest.Kernel",
"Cosmos.Kernel.Tests.DiskManager.Kernel",
"GraphicTest.Kernel",
"NetworkTest.Kernel",
"AudioTests.Kernel",
"MemoryOperationsTest.Kernel",
"ProcessorTests.Kernel"
]
env:
USER_KIT_PATH: 'C:\CosmosRun\'
BochsPath: 'C:\Program Files (x86)\Bochs-2.6.8\Bochs.exe'
steps:
- name: Checkout Cosmos
uses: actions/checkout@v3
with:
repository: CosmosOS/Cosmos
path: Cosmos
- name: Checkout Common
uses: actions/checkout@v3
with:
repository: CosmosOS/Common
path: Common
- name: Checkout IL2CPU
uses: actions/checkout@v3
with:
repository: CosmosOS/IL2CPU
path: IL2CPU
- name: Checkout XSharp
uses: actions/checkout@v3
with:
repository: CosmosOS/XSharp
path: XSharp
- name: Copy Bochs
run: |
xcopy /Y /S "Cosmos\Resources\Bochs\*.*" "${env:ProgramFiles(x86)}\Bochs-2.6.8\"
- name: Test - Cosmos
env:
CI: "True"
run: |
dotnet test "Cosmos\Tests\Cosmos.TestRunner.UnitTest\Cosmos.TestRunner.UnitTest.csproj" --logger "trx;LogFileName=$($env:USER_KIT_PATH)TestResults\${{ matrix.kernel }}-TestResult.trx" --filter "FullyQualifiedName~${{ matrix.kernel }}"
- name: Upload Test Logs
uses: actions/upload-artifact@v3
with:
name: test-logs
path: ${{ env.USER_KIT_PATH }}TestResults