Skip to content

Commit

Permalink
Add a test report to the build
Browse files Browse the repository at this point in the history
  • Loading branch information
damianh committed Oct 5, 2024
1 parent 0e19178 commit 2277b5b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/access-token-management-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ jobs:
dotnet-version: |
8.0.x
- name: Build and test
- name: Build and Test
shell: pwsh
run: ./build.ps1
run: ./build.ps1

- name: Test Report
id: test-report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Test results
path: artifacts/test-results/*.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
10 changes: 7 additions & 3 deletions access-token-management/build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ internal static async Task Main(string[] args)

Target(Targets.Test, DependsOn(Targets.Build), () =>
{
Run("dotnet", "test -c Release --no-build --nologo");
Run("dotnet",
$"test test/Tests -c Release --nologo "
+ $"--blame-hang "
+ $"--blame-hang-timeout=120sec "
+ $"--logger \"console;verbosity=normal\" --logger \"trx;LogFileName=Test.trx\"");
});

Target(Targets.CleanPackOutput, () =>
Expand All @@ -56,8 +60,8 @@ internal static async Task Main(string[] args)

Target(Targets.Pack, DependsOn(Targets.Build, Targets.CleanPackOutput), () =>
{
Run("dotnet", $"pack ./src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo");
Run("dotnet", $"pack ./src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo");
Run("dotnet", $"pack src/Duende.AccessTokenManagement/Duende.AccessTokenManagement.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo");
Run("dotnet", $"pack src/Duende.AccessTokenManagement.OpenIdConnect/Duende.AccessTokenManagement.OpenIdConnect.csproj -c Release -o {Directory.CreateDirectory(packOutput).FullName} --no-build --nologo");
});

Target(Targets.SignPackage, DependsOn(Targets.Pack, Targets.RestoreTools), () =>
Expand Down

0 comments on commit 2277b5b

Please sign in to comment.