fix: Update CI/CD workflow to skip integration tests and adjust Docke… #27
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: Code Coverage Report | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| coverage: | |
| name: Generate Coverage Report | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore src/EChamado/EChamado.sln | |
| - name: Build | |
| run: dotnet build src/EChamado/EChamado.sln --configuration Release --no-restore | |
| - name: Test with Coverage | |
| run: | | |
| dotnet test src/EChamado/EChamado.sln --configuration Release \ | |
| --no-build \ | |
| --verbosity normal \ | |
| /p:CollectCoverage=true \ | |
| /p:CoverletOutputFormat=cobertura \ | |
| /p:CoverletOutput=./TestResults/ | |
| - name: Generate Coverage Report | |
| uses: danielpalme/ReportGenerator-GitHub-Action@5.3.10 | |
| with: | |
| reports: '**/coverage.cobertura.xml' | |
| targetdir: 'coveragereport' | |
| reporttypes: 'Html;Badges' | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coveragereport | |
| - name: Add Coverage Comment to PR | |
| if: github.event_name == 'pull_request' | |
| uses: 5monkeys/cobertura-action@master | |
| with: | |
| path: '**/coverage.cobertura.xml' | |
| minimum_coverage: 70 | |
| fail_below_threshold: true |