Add tests and workflows to solution file #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: .NET Tests | |
| on: | |
| push: | |
| branches: [ main, develop, developv2 ] | |
| pull_request: | |
| branches: [ main, develop, developv2 ] | |
| jobs: | |
| test: | |
| name: Build and Test | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Test | |
| run: dotnet test --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: '**/test-results.trx' | |
| - name: Test Summary | |
| if: always() | |
| uses: dorny/test-reporter@v1 | |
| with: | |
| name: Test Results | |
| path: '**/test-results.trx' | |
| reporter: dotnet-trx | |
| fail-on-error: true |