name: PR Tests on: pull_request: branches: [ main, develop ] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build --no-restore - name: Test with results run: dotnet test --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory ./TestResults - name: Test with coverage run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info - name: Upload coverage report to PR uses: actions/upload-artifact@v4 with: name: code-coverage-report path: ./lcov.info - name: Comment PR with test results uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: files: "**/TestResults/*.trx" - name: Add Coverage PR Comment uses: codecov/codecov-action@v3 with: file: ./lcov.info fail_ci_if_error: false verbose: true