Skip to content

Add test report as check run #3

Add test report as check run

Add test report as check run #3

name: "Build"
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
pull_request:
branches:
- main
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
workflow_dispatch:
permissions:
contents: read
actions: read
checks: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false
DOTNET_MULTILEVEL_LOOKUP: 0
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true
TERM: xterm
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.302
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --logger trx
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests
path: WebApi.Tests/TestResults/*.trx
reporter: dotnet-trx