Bump the testing group with 5 updates #23
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: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| env: | |
| DOTNET_VERSION: '8.0.x' | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Test with coverage | |
| run: | | |
| dotnet test --no-build --configuration Release \ | |
| --collect:"XPlat Code Coverage" \ | |
| --results-directory ./coverage \ | |
| --logger "trx;LogFileName=test-results.trx" | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: coverage/*.trx | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: coverage-reports | |
| path: coverage/**/coverage.cobertura.xml | |
| - name: Code Coverage Summary | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| if: success() | |
| with: | |
| filename: coverage/**/coverage.cobertura.xml | |
| badge: true | |
| format: markdown | |
| output: both | |
| thresholds: '60 80' | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| if: github.event_name == 'pull_request' && success() | |
| with: | |
| recreate: true | |
| path: code-coverage-results.md | |
| lint: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Check formatting | |
| run: dotnet format --verify-no-changes --verbosity diagnostic | |
| - name: Build with warnings as errors (Release) | |
| run: dotnet build --configuration Release /p:TreatWarningsAsErrors=true |