Skip to content

Commit

Permalink
PR friendly test reports
Browse files Browse the repository at this point in the history
  • Loading branch information
artiomchi committed Nov 20, 2023
1 parent 69ba956 commit c2c9f95
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@ name: Build
on: [push, pull_request]

jobs:
build-quick:
name: Quick Build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0'
- uses: actions/checkout@v3
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test ./test/FlexLabs.EntityFrameworkCore.Upsert.Tests --no-build --logger "trx;LogFileName=test-results.trx"
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results (quick)
path: '**/TestResults/*.trx'
reporter: dotnet-trx

build-ubuntu:
name: Full Build (Ubuntu)
runs-on: ubuntu-latest
Expand All @@ -40,16 +18,14 @@ jobs:
- name: Test
run: dotnet test --no-build --logger "trx;LogFileName=test-results.trx"
- name: Test Report
uses: dorny/test-reporter@v1
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: Test Results (ubuntu)
name: test-results
path: '**/TestResults/*.trx'
reporter: dotnet-trx


build-windows:
name: Full Build (Windows)
name: Build on Windows
runs-on: windows-latest
steps:
- uses: actions/setup-dotnet@v3
Expand All @@ -67,12 +43,10 @@ jobs:
- name: Test
env:
USE_LOCAL_SERVICE: 'true'
run: dotnet test --no-build --logger "trx;LogFileName=test-results.trx"
run: dotnet test ./test/FlexLabs.EntityFrameworkCore.Upsert.IntegrationTests --no-build --logger "trx;LogFileName=test-results.trx"
- name: Test Report
uses: dorny/test-reporter@v1
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: Test Results (windows)
name: test-results-win
path: '**/TestResults/*.trx'
reporter: dotnet-trx

31 changes: 31 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Test Report'

on:
workflow_run:
workflows: ['Build']
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Extract test results
uses: dorny/test-reporter@v1
with:
artifact: test-results
name: Test Results (Ubuntu)
path: '**/TestResults/*.trx'
reporter: dotnet-trx
- name: Extract test results (Windows)
uses: dorny/test-reporter@v1
with:
artifact: test-results-win
name: Test Results (Windows)
path: '**/TestResults/*.trx'
reporter: dotnet-trx

0 comments on commit c2c9f95

Please sign in to comment.