49 lines
1.3 KiB
YAML
49 lines
1.3 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
|
|
name: .NET ${{ matrix.dotnet-version }}
|
|
|
|
strategy:
|
|
matrix:
|
|
dotnet-version: [ '8.0', '9.0' ]
|
|
env:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Setup .NET
|
|
uses: https://github.com/actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: ${{ matrix.dotnet-version }}.x
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore -p:TargetFramework=net${{ matrix.dotnet-version }}
|
|
|
|
- name: Build
|
|
run: dotnet build --framework net${{ matrix.dotnet-version }} --configuration Release ./Core.Tests/Core.Tests.csproj
|
|
|
|
- name: Test
|
|
run: dotnet run --no-build --framework net${{ matrix.dotnet-version }} --configuration Release --project ./Core.Tests/Core.Tests.csproj -- -trx results-net${{ matrix.dotnet-version }}.trx
|
|
|
|
- name: Upload dotnet test results
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: results-net${{ matrix.dotnet-version }}
|
|
path: results-net${{ matrix.dotnet-version }}.trx
|
|
if: ${{ always() }}
|
|
retention-days: 30
|