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 a7559e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 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: src/helix/artifacts/test-results/*.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
10 changes: 8 additions & 2 deletions access-token-management/build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ internal static async Task Main(string[] args)
Target(Targets.Test, DependsOn(Targets.Build), () =>
{
Run("dotnet", "test -c Release --no-build --nologo");
await Run(

Check failure on line 47 in access-token-management/build/Program.cs

View workflow job for this annotation

GitHub Actions / build

The 'await' operator can only be used within an async lambda expression. Consider marking this lambda expression with the 'async' modifier.

Check failure on line 47 in access-token-management/build/Program.cs

View workflow job for this annotation

GitHub Actions / build

Cannot await 'void'
"dotnet",
$"test test/Tests -c Release --nologo"
+ $"--blame-hang "
+ $"--blame-hang-timeout=120sec "
+ $"--logger \"console;verbosity=normal\" --logger \"trx;LogFileName={packOutput}/test-results/Test.trx\" ");
});

Target(Targets.CleanPackOutput, () =>
Expand All @@ -56,8 +62,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 a7559e3

Please sign in to comment.