chore(deps): Bump coverlet.collector from 6.0.4 to 8.0.0 #61
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: '10.0.x' | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| jobs: | |
| build: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Run Unit Tests | |
| run: | | |
| dotnet test tests/OrderMonitor.UnitTests/OrderMonitor.UnitTests.csproj \ | |
| --no-build \ | |
| --configuration Release \ | |
| --logger "trx;LogFileName=unit-test-results.trx" \ | |
| --collect:"XPlat Code Coverage" \ | |
| --results-directory ./TestResults | |
| - name: Run Integration Tests | |
| run: | | |
| dotnet test tests/OrderMonitor.IntegrationTests/OrderMonitor.IntegrationTests.csproj \ | |
| --no-build \ | |
| --configuration Release \ | |
| --logger "trx;LogFileName=integration-test-results.trx" \ | |
| --results-directory ./TestResults | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: ./TestResults | |
| retention-days: 7 | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-report | |
| path: ./TestResults/**/coverage.cobertura.xml | |
| retention-days: 7 | |
| - name: Code Coverage Summary | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| if: always() | |
| with: | |
| filename: ./TestResults/**/coverage.cobertura.xml | |
| badge: true | |
| format: markdown | |
| output: both | |
| thresholds: '60 80' | |
| lint: | |
| name: Code Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: Run Code Analysis | |
| run: dotnet build --no-restore --configuration Release /p:TreatWarningsAsErrors=false | |
| validate-manifests: | |
| name: Validate K8s Manifests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Validate YAML syntax | |
| run: | | |
| pip install pyyaml | |
| for f in k8s/base/*.yaml; do | |
| echo "Validating $f..." | |
| python3 -c "import yaml; yaml.safe_load(open('$f'))" | |
| done | |
| - name: Validate Kustomize overlays | |
| run: | | |
| echo "Validating staging overlay..." | |
| kubectl kustomize k8s/overlays/staging > /dev/null | |
| echo "Validating production overlay..." | |
| kubectl kustomize k8s/overlays/production > /dev/null | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: Run Security Audit | |
| run: dotnet list package --vulnerable --include-transitive 2>&1 | tee security-report.txt | |
| - name: Upload Security Report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: security-report | |
| path: security-report.txt | |
| retention-days: 7 |