Skip to content

Commit 26b73bb

Browse files
committed
Add CI
1 parent 85cc836 commit 26b73bb

File tree

2 files changed

+49
-13
lines changed

2 files changed

+49
-13
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
Build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
lfs: true
18+
19+
- name: Restore packages
20+
run: nuget restore
21+
working-directory: ./Source
22+
23+
- name: Setup build
24+
uses: microsoft/setup-msbuild@v2
25+
26+
- name: Build targets
27+
run: msbuild /t:ExplorerCommand /t:glTF /t:Tests /p:Configuration=Release /p:Platform=x64
28+
working-directory: ./Source
29+
30+
- name: Run tests
31+
run: dotnet test ./Build/Tests/bin/Release/AnyCPU/Tests.dll -s ./Source/.runsettings -v n

Source/Tests/Core.cs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ public sealed class Core(TestContext testContext)
1414

1515
public async Task ValidateAsync(string filePath)
1616
{
17-
using var process = Process.Start(ValidatorExePath, [filePath]);
17+
using var process = Process.Start(new ProcessStartInfo(ValidatorExePath, [filePath])
18+
{
19+
RedirectStandardError = true,
20+
RedirectStandardOutput = true,
21+
})!;
22+
1823
await process.WaitForExitAsync(this.cancellationToken);
1924
if (process.ExitCode != 0)
2025
{
@@ -61,17 +66,6 @@ public async Task Pack_BoxTextured()
6166
await this.ValidateAsync(outputFilePath);
6267
}
6368

64-
[TestMethod]
65-
public async Task Pack_LightsIES()
66-
{
67-
string[] filePaths = [@"LightsIES\Example.gltf", @"LightsIES\Example_bufferview.gltf", @"LightsIES\Example_dataUri.gltf"];
68-
foreach (var filePath in filePaths)
69-
{
70-
var outputFilePath = this.Unpack(this.Pack(filePath));
71-
await this.ValidateAsync(outputFilePath);
72-
}
73-
}
74-
7569
[TestMethod]
7670
public async Task Unpack_Box()
7771
{
@@ -87,10 +81,21 @@ public async Task Unpack_BoxTextured()
8781
}
8882

8983
[TestMethod]
90-
public async Task Pack_And_Unpack_BoxTextured_Embedded()
84+
public async Task Pack_Unpack_BoxTextured_Embedded()
9185
{
9286
var outputFilePath = this.Unpack(this.Pack(@"BoxTextured\glTF-Embedded\BoxTextured.gltf"));
9387
await this.ValidateAsync(outputFilePath);
9488
}
89+
90+
[TestMethod]
91+
public async Task Pack_Unpack_LightsIES()
92+
{
93+
string[] filePaths = [@"LightsIES\Example.gltf", @"LightsIES\Example_bufferview.gltf", @"LightsIES\Example_dataUri.gltf"];
94+
foreach (var filePath in filePaths)
95+
{
96+
var outputFilePath = this.Unpack(this.Pack(filePath));
97+
await this.ValidateAsync(outputFilePath);
98+
}
99+
}
95100
}
96101
}

0 commit comments

Comments
 (0)