Skip to content

Commit a4b9456

Browse files
committed
Update TUnit and publish test report
1 parent b39729a commit a4b9456

4 files changed

Lines changed: 51 additions & 12 deletions

File tree

.build.ps1

Lines changed: 14 additions & 10 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,32 +41,33 @@ task DotnetBuild DotnetRestore, {
3841
}
3942

4043
task DotnetTest DotnetBuild, {
41-
Push-Location "./test/TinyLogger.Tests"
42-
4344
exec {
44-
dotnet test --disable-logo --no-build
45+
dotnet test `
46+
--disable-logo `
47+
--no-build `
48+
--results-directory $testResultsFolder
4549
}
4650
}
4751

4852
task AotTest {
49-
$binary = $IsWindows ? "./TinyLogger.Tests.exe" : "./TinyLogger.Tests"
5053
$runtime = $IsWindows ? "win-x64" : "linux-x64"
54+
$binaryPath = Join-Path "artifacts" "publish" "TinyLogger.Tests" "release_$runtime"
55+
$binary = $IsWindows ? "$binaryPath/TinyLogger.Tests.exe" : "$binaryPath/TinyLogger.Tests"
5156

52-
Push-Location "./test/TinyLogger.Tests"
5357
exec {
54-
dotnet publish /p:"Aot=true" --runtime $runtime
58+
dotnet publish (Join-Path "test" "TinyLogger.Tests") `
59+
--runtime $runtime `
60+
-p:"Aot=true"
5561
}
56-
Pop-Location
5762

58-
Push-Location "./artifacts/publish/TinyLogger.Tests/release_net10.0_$runtime/"
5963
exec {
60-
& $binary --disable-logo
64+
& $binary --disable-logo --results-directory $testResultsFolder
6165
}
6266
}
6367

6468
task DotnetPack AssertVersion, {
6569
exec {
66-
dotnet pack .\src\TinyLogger\TinyLogger.csproj `
70+
dotnet pack (Join-Path "src" "TinyLogger") `
6771
--configuration Release `
6872
--output . `
6973
/p:ContinuousIntegrationBuild="true" `

.github/workflows/build.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,26 @@ jobs:
3131
run: dotnet build --no-restore
3232

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

test/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
1313
<PackageVersion Include="Shouldly" Version="4.3.0" />
1414
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
15-
<PackageVersion Include="TUnit.Engine" Version="1.22.6" />
15+
<PackageVersion Include="TUnit.Engine" Version="1.24.0" />
1616
</ItemGroup>
1717

1818
</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)