Skip to content

Commit

Permalink
Merge branch 'master' into feature/auto_gc
Browse files Browse the repository at this point in the history
  • Loading branch information
quajak authored Oct 13, 2023
2 parents 6abcaf3 + 95a6434 commit 16ae7a7
Show file tree
Hide file tree
Showing 77 changed files with 79,531 additions and 133 deletions.
129 changes: 99 additions & 30 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ name: Build and Test

on:
workflow_dispatch:
# pull_request:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:

runs-on: windows-2022
runs-on: self-hosted

outputs:
testkernels: ${{ steps.testkernels_output.outputs.testkernels }}

env:
USER_KIT_PATH: 'C:\CosmosRun\'
BOCHS_RUN_CMD: '\"C:\Program Files (x86)\Bochs-2.6.8\Bochs.exe\" -q -f \"%1\"'
BochsPath: 'C:\Program Files (x86)\Bochs-2.6.8\Bochs.exe'

steps:
- name: Checkout Cosmos
Expand All @@ -22,37 +25,27 @@ jobs:
repository: CosmosOS/Cosmos
path: Cosmos

# - name: Checkout Common
# uses: actions/checkout@v3
# with:
# repository: CosmosOS/Common
# path: Common
- 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: Checkout XSharp
uses: actions/checkout@v3
with:
repository: CosmosOS/XSharp
path: XSharp

- name: Setup MSBuild
uses: microsoft/[email protected]

- name: Setup Registry
run: |
Write-Host "Setting Cosmos User Kit Path to $($env:USER_KIT_PATH)"
reg add HKLM\SOFTWARE\WOW6432Node\Cosmos /v UserKit /d "$($env:USER_KIT_PATH)"
reg query HKLM\SOFTWARE\WOW6432Node\Cosmos
Write-Host "Setting Bochs Run Command to $($env:BOCHS_RUN_CMD)"
reg add HKCR\BochsConfigFile\shell\Run\command /ve /d "$($env:BOCHS_RUN_CMD)"
reg query HKCR\BochsConfigFile\shell\Run\command
- name: Nuget - Cache
uses: actions/cache@v3
with:
Expand All @@ -71,26 +64,102 @@ jobs:
- name: Build - IL2CPU
run: |
dotnet publish IL2CPU\source\IL2CPU -r win7-x86 -o "$($env:USER_KIT_PATH)Build\IL2CPU\"
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\"
xcopy /Y /S "Cosmos\Resources\Bochs\*.*" "%ProgramFiles(x86)%\Bochs-2.6.8\"
- name: Copy Output - IL2CPU
run: |
xcopy /Y "IL2CPU\source\Cosmos.Core.DebugStub\*.xs" "$($env:USER_KIT_PATH)XSharp\DebugStub\"
- name: Test - Cosmos
# - 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: |
dotnet test Cosmos\Tests\Cosmos.TestRunner.UnitTest\Cosmos.TestRunner.UnitTest.csproj --logger "trx;LogFileName=$($env:USER_KIT_PATH)TestResult.xml"
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)TestResult.xml
path: ${{ env.USER_KIT_PATH }}TestResults
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Docs/log.txt
*.docstates
*.vsp
*.pdb
*.lock.json
Thumbs.db
build.force

Expand Down
14 changes: 8 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<Project>

<PropertyGroup>
<LangVersion>Latest</LangVersion>
<NoWarn>CA1051;CA1501;CA1707;CA1711;CA1801;CS1572;CS1573;CS1574;CS1591;$(NoWarn)</NoWarn>
<SignAssembly>True</SignAssembly>
</PropertyGroup>

<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<CommonRepoRoot>$(RepoRoot)..\Common\</CommonRepoRoot>
<IL2CPURepoRoot>$(RepoRoot)..\IL2CPU\</IL2CPURepoRoot>
<XSharpRepoRoot>$(RepoRoot)..\XSharp\</XSharpRepoRoot>
</PropertyGroup>

<PropertyGroup>
<LangVersion>Latest</LangVersion>
<NoWarn>CA1051;CA1501;CA1707;CA1711;CA1801;CS1572;CS1573;CS1574;CS1591;NU1603;$(NoWarn)</NoWarn>
<SignAssembly>True</SignAssembly>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>

<PropertyGroup>
<!--
This property sets the suffix for local builds.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 1,
"dependencies": {
".NETFramework,Version=v4.8": {
"Dapper.StrongName": {
"type": "Direct",
"requested": "[2.0.90, )",
"resolved": "2.0.90",
"contentHash": "oYmC8zT97TBlmNcU/xM54CJC6sgG+VUmUhRN5tg05P1Y3H4wx7vU+xBM6MgEJ21aXAXsTctchPs5TCsbRdIxJw=="
},
"Microsoft.CSharp": {
"type": "Direct",
"requested": "[4.7.0, )",
"resolved": "4.7.0",
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
}
}
}
}
Loading

0 comments on commit 16ae7a7

Please sign in to comment.