Repository navigation
Publish and verify Exhaustion before releasing RestClient.Net #10
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
| # agent-pmo:372ce7f | |
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| name: CI | |
| if: github.actor != 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Isolate NuGet cache | |
| run: echo "NUGET_PACKAGES=$RUNNER_TEMP/ci-nuget" >> "$GITHUB_ENV" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Restore .NET tools | |
| run: dotnet tool restore | |
| - name: Restore dependencies | |
| run: | | |
| python3 scripts/release.py pack-analyzer --output .artifacts/packages | |
| dotnet restore RestClient.sln --source "$PWD/.artifacts/packages" --source https://api.nuget.org/v3/index.json | |
| - name: Check code formatting with CSharpier | |
| run: dotnet csharpier --check . | |
| - name: Build solution | |
| run: dotnet build RestClient.sln --configuration Release --no-restore /warnaserror | |
| - name: Run code analysis | |
| run: dotnet build RestClient.sln --configuration Release --no-restore /p:RunAnalyzers=true /p:TreatWarningsAsErrors=true | |
| - name: Run Stryker Mutation Testing | |
| working-directory: RestClient.Net.CsTest | |
| run: dotnet stryker --break-at 100 | |
| - name: Verify Docker is available | |
| run: | | |
| docker --version | |
| docker compose version | |
| - name: Run all tests with code coverage | |
| run: dotnet test RestClient.sln --configuration Release --no-build --verbosity normal --logger "console;verbosity=detailed" --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Threshold=100 DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ThresholdType=line,branch,method DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.ThresholdStat=total | |
| - name: Run F# tests outside the solution | |
| run: dotnet test RestClient.Net.FsTest/RestClient.Net.FsTest.fsproj --configuration Release --verbosity normal | |
| - name: Test release ordering and artifact verification | |
| run: python3 -m unittest discover -s scripts/tests -p test_release_orchestration.py -v | |
| - name: Build and test release packages before publication | |
| id: release_versions | |
| run: | | |
| python3 scripts/release.py versions >> "$GITHUB_OUTPUT" | |
| python3 scripts/release.py pack --output .artifacts/release | |
| - name: Verify fixed analyzer through package consumers | |
| env: | |
| CLIENT_VERSION: ${{ steps.release_versions.outputs.client_version }} | |
| ANALYZER_VERSION: ${{ steps.release_versions.outputs.analyzer_version }} | |
| run: | | |
| for framework in net8.0 net9.0; do | |
| python3 scripts/tests/test_release_packages.py --packages .artifacts/release --restclient-version "$CLIENT_VERSION" --exhaustion-version "$ANALYZER_VERSION" --framework "$framework" | |
| done | |
| - name: Cleanup Docker containers | |
| if: always() | |
| run: | | |
| cd Samples/NucliaDbClient | |
| docker compose down -v --remove-orphans || true |