.xml removed from coverlet.runsettings in workflow #7
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 (collector) | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| workflow_dispatch: {} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # only needed if you use Codecov with OIDC | |
| strategy: | |
| matrix: | |
| include: | |
| - name: UserManagementApi.Tests.Unit | |
| proj: UserManagementApi.Tests.Unit/UserManagementApi.Tests.Unit.csproj | |
| - name: UserManagementApi.Tests.Integration | |
| proj: UserManagementApi.Tests.Integration/UserManagementApi.Tests.Integration.csproj | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: 'Sanity - show files at repo root' | |
| run: ls -la | |
| - name: 'Restore' | |
| run: dotnet restore | |
| - name: 'Build (Release)' | |
| run: dotnet build --configuration Release --no-restore | |
| - name: 'Test with coverage (collector → LCOV)' | |
| run: | | |
| dotnet test "${{ matrix.proj }}" \ | |
| --no-build \ | |
| --collect:"XPlat Code Coverage" \ | |
| --settings coverlet.runsettings \ | |
| --results-directory "./TestResults/${{ matrix.name }}" \ | |
| --logger "trx;LogFileName=${{ matrix.name }}.trx" \ | |
| -v n | |
| - name: 'Upload coverage + TRX' | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }}-results | |
| path: | | |
| TestResults/${{ matrix.name }}/**/coverage.info | |
| TestResults/${{ matrix.name }}/**/*.trx | |
| - name: 'Upload to Codecov' | |
| if: success() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: TestResults/${{ matrix.name }}/**/coverage.info | |
| flags: ${{ matrix.name }} | |
| fail_ci_if_error: true | |
| use_oidc: true |