TVF and split queries #8
Workflow file for this run
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: Tests & Coverage | |
| on: | |
| pull_request: | |
| branches: | |
| - '**' | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| test: | |
| name: Tests & Code Coverage | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore src/Dime.Repositories.slnx | |
| - name: Build solution | |
| run: dotnet build src/Dime.Repositories.slnx -c Release --no-restore | |
| - name: Run unit tests with coverage | |
| run: | | |
| dotnet test src/test/Dime.Repositories.Sql.EntityFramework.Tests/Dime.Repositories.Sql.EntityFramework.Tests.csproj \ | |
| -c Release --no-build \ | |
| --logger "trx;LogFileName=unit-tests.trx" \ | |
| --results-directory TestResults/unit \ | |
| --collect:"XPlat Code Coverage" \ | |
| --settings src/coverlet.runsettings | |
| - name: Run integration tests with coverage | |
| timeout-minutes: 15 | |
| run: | | |
| dotnet test src/test/Dime.Repositories.Sql.EntityFramework.IntegrationTests/Dime.Repositories.Sql.EntityFramework.IntegrationTests.csproj \ | |
| -c Release --no-build \ | |
| --logger "trx;LogFileName=integration-tests.trx" \ | |
| --results-directory TestResults/integration \ | |
| --collect:"XPlat Code Coverage" \ | |
| --settings src/coverlet.runsettings | |
| - name: Install ReportGenerator | |
| if: always() | |
| run: dotnet tool install -g dotnet-reportgenerator-globaltool | |
| - name: Merge coverage and generate report | |
| if: always() | |
| run: | | |
| reportgenerator \ | |
| "-reports:TestResults/**/coverage.cobertura.xml" \ | |
| "-targetdir:CoverageReport" \ | |
| "-reporttypes:Html;MarkdownSummaryGithub;Cobertura;TextSummary" \ | |
| "-title:Dime.Repositories Coverage" | |
| - name: Append coverage to job summary | |
| if: always() | |
| run: | | |
| if [ -f CoverageReport/SummaryGithub.md ]; then | |
| cat CoverageReport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ -f CoverageReport/Summary.txt ]; then | |
| echo "::group::Coverage summary" | |
| cat CoverageReport/Summary.txt | |
| echo "::endgroup::" | |
| fi | |
| - name: Post coverage comment on PR | |
| if: always() && github.event_name == 'pull_request' | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: CoverageReport/Cobertura.xml | |
| badge: true | |
| fail_below_min: false | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: true | |
| indicators: true | |
| output: both | |
| thresholds: '60 90' | |
| - name: Attach coverage comment to PR | |
| if: always() && github.event_name == 'pull_request' | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| recreate: true | |
| path: code-coverage-results.md | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: TestResults | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: CoverageReport |