Sandbox Tests #44
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: Sandbox Tests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Run daily at 08:00 UTC to catch sandbox API changes early. | |
| - cron: '0 8 * * *' | |
| permissions: | |
| checks: write | |
| contents: read | |
| jobs: | |
| sandbox: | |
| name: Sandbox Integration Tests | |
| if: github.repository_owner == 'MonumentalSystems' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Cache NuGet packages | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Run sandbox tests | |
| env: | |
| MERCURY_SANDBOX_TOKEN: ${{ secrets.MERCURY_SANDBOX_TOKEN }} | |
| run: >- | |
| dotnet test tests/MercuryBankApi.Sandbox.Tests --no-build | |
| --logger "trx;LogFileName=test-results.trx" | |
| --logger "console;verbosity=detailed" | |
| --results-directory ./TestResults | |
| --collect:"XPlat Code Coverage" | |
| - name: Test Report | |
| if: always() | |
| uses: dorny/test-reporter@b082adf0eced0765477756c2a610396589b8c637 # v2.5.0 | |
| with: | |
| name: Sandbox Test Results | |
| path: TestResults/**/*.trx | |
| reporter: dotnet-trx | |
| fail-on-error: true | |
| fail-on-empty: true | |
| - name: Coverage Summary | |
| if: always() | |
| uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 | |
| with: | |
| filename: TestResults/**/coverage.cobertura.xml | |
| badge: true | |
| format: markdown | |
| output: both | |
| thresholds: '60 80' | |
| indicators: true | |
| hide_complexity: true | |
| - name: Coverage Report to Summary | |
| if: always() | |
| run: cat code-coverage-results.md >> "$GITHUB_STEP_SUMMARY" |