48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
name: .NET Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
tags-ignore:
|
|
- '**'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- '.gitea/workflows/publish-*.yaml'
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
dotnet-version: [ '8.x', '9.x' ]
|
|
env:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Setup .NET ${{ matrix.dotnet-version }}
|
|
uses: https://github.com/actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: ${{ matrix.dotnet-version }}
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build
|
|
run: dotnet build --no-restore
|
|
|
|
- name: Test
|
|
run: dotnet test --no-build --verbosity normal --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
|
|
|
|
- name: Upload dotnet test results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dotnet-results-${{ matrix.dotnet-version }}
|
|
path: TestResults-${{ matrix.dotnet-version }}
|
|
if: ${{ always() }}
|
|
retention-days: 30
|