-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (48 loc) · 1.46 KB
/
tests.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
name: .NET Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: |
cd SkEditor
dotnet restore
- name: Build project
run: |
cd SkEditor
dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true -p:PublishReadyToRun=true --no-self-contained --nologo -v q --property WarningLevel=0 /clp:ErrorsOnly /p:DebugType=None /p:DebugSymbols=false
- name: Check executable path
run: |
$exePath = "SkEditor\\bin\\Release\\net8.0\\win-x64\\publish\\SkEditor.exe"
if (Test-Path $exePath) {
Write-Host "Executable found at $exePath"
} else {
Write-Host "Executable not found at $exePath"
exit 1
}
- name: Run tests
run: |
$exePath = "SkEditor\\bin\\Release\\net8.0\\win-x64\\publish\\SkEditor.exe"
Write-Host "Running tests from $exePath"
& $exePath --test | Out-File -FilePath test_output.txt
$result = Get-Content -Path test_output.txt
Write-Host "Test result: $result"
if ($result -match "Test passed") {
Write-Host "Tests passed"
} else {
Write-Host "Tests failed"
exit 1
}