Skip to content

Commit 1abd543

Browse files
committed
Update TUnit, publish HTML test report and use root relative paths in CI
1 parent 387ef57 commit 1abd543

4 files changed

Lines changed: 52 additions & 12 deletions

File tree

.build.ps1

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ param (
77
$Version
88
)
99

10+
$artifactFolder = "artifacts"
11+
$testResultsFolder = Join-Path $artifactFolder "testresults"
12+
1013
task AssertVersion {
1114
if (-not $Version) {
1215
throw "Specify version with -Version parameter"
@@ -38,29 +41,32 @@ task DotnetBuild DotnetRestore, {
3841
}
3942

4043
task DotnetTest DotnetBuild, {
41-
Push-Location "./test/TinyIpc.Tests"
42-
4344
exec {
44-
dotnet test --disable-logo --no-build --max-parallel-test-modules 1
45+
dotnet test `
46+
--disable-logo `
47+
--no-build `
48+
--max-parallel-test-modules 1 `
49+
--results-directory $testResultsFolder
4550
}
4651
}
4752

4853
task AotTest {
49-
Push-Location "./test/TinyIpc.Tests"
54+
$binary = Join-Path "artifacts" "publish" "TinyIpc.Tests" "release_net10.0-windows_win-x64" "TinyIpc.Tests.exe"
55+
5056
exec {
51-
dotnet publish /p:"Aot=true" --framework "net10.0-windows"
57+
dotnet publish (Join-Path "test" "TinyIpc.Tests") `
58+
--framework "net10.0-windows" `
59+
-p:"Aot=true"
5260
}
53-
Pop-Location
5461

55-
Push-Location "./artifacts/publish/TinyIpc.Tests/release_net10.0-windows_win-x64/"
5662
exec {
57-
.\TinyIpc.Tests.exe --disable-logo
63+
& $binary --disable-logo --results-directory $testResultsFolder
5864
}
5965
}
6066

6167
task DotnetPack AssertVersion, {
6268
exec {
63-
dotnet pack ".\src\TinyIpc\TinyIpc.csproj" `
69+
dotnet pack (Join-Path "src" "TinyIpc") `
6470
--configuration Release `
6571
--output . `
6672
/p:ContinuousIntegrationBuild="true" `

.github/workflows/build.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,25 @@ jobs:
2727
run: dotnet build --no-restore
2828

2929
- name: Run tests
30-
run: dotnet test --output Detailed --no-build --no-progress --max-parallel-test-modules 1
31-
working-directory: test/TinyIpc.Tests
30+
run: dotnet test --output Detailed --no-build --no-progress --max-parallel-test-modules 1 --results-directory "artifacts/testresults"
31+
32+
- name: Upload Test Report (net10.0)
33+
uses: actions/upload-artifact@v7
34+
if: always()
35+
with:
36+
archive: false
37+
path: 'artifacts/testresults/TinyIpc.Tests-windows-net10.0-report.html'
38+
39+
- name: Upload Test Report (net8.0)
40+
uses: actions/upload-artifact@v7
41+
if: always()
42+
with:
43+
archive: false
44+
path: 'artifacts/testresults/TinyIpc.Tests-windows-net8.0-report.html'
45+
46+
- name: Upload Test Report (net48)
47+
uses: actions/upload-artifact@v7
48+
if: always()
49+
with:
50+
archive: false
51+
path: 'artifacts/testresults/TinyIpc.Tests-windows-net48-report.html'

test/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
99
<PackageVersion Include="Shouldly" Version="4.3.0" />
10-
<PackageVersion Include="TUnit.Engine" Version="1.22.6" />
10+
<PackageVersion Include="TUnit.Engine" Version="1.23.7" />
1111
</ItemGroup>
1212

1313
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma warning disable IDE0130 // Namespace does not match folder structure
2+
#if !NET
3+
using System.Diagnostics;
4+
using System.Diagnostics.CodeAnalysis;
5+
6+
namespace System.Runtime.CompilerServices;
7+
8+
[ExcludeFromCodeCoverage]
9+
[DebuggerNonUserCode]
10+
[AttributeUsage(
11+
validOn: AttributeTargets.Method,
12+
Inherited = false)]
13+
internal sealed class ModuleInitializerAttribute : Attribute;
14+
#endif

0 commit comments

Comments
 (0)