feat(exceptions): enrich SamsaraApiException with request and respons… #29
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] | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'LICENSE' | |
| - 'CHANGELOG.md' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'LICENSE' | |
| - 'CHANGELOG.md' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build & Test (.NET ${{ matrix.dotnet }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dotnet: ['8.0.x'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for MinVer to calculate version from git history | |
| - name: Setup .NET ${{ matrix.dotnet }} | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet }} | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'Directory.Build.props') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Test (unit) | |
| run: > | |
| dotnet test tests/Samsara.Sdk.Tests/Samsara.Sdk.Tests.csproj | |
| --no-build | |
| --configuration Release | |
| --collect:"XPlat Code Coverage" | |
| --results-directory ./coverage | |
| --logger "trx;LogFileName=unit-tests.trx" | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-${{ matrix.dotnet }} | |
| path: ./coverage/**/*.trx | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: always() | |
| with: | |
| directory: ./coverage | |
| flags: unittests | |
| fail_ci_if_error: false | |
| sdk-sync: | |
| name: SDK ↔ Spec endpoint check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Verify every SDK endpoint exists in the live spec | |
| run: python3 tools/check-sdk-sync.py --fail-on-mismatch | |
| - name: Verify no fabricated / mis-homed SDK methods | |
| run: python3 tools/check-sdk-fabrication.py --fail-on-issues | |
| - name: Verify SDK model shapes match the spec (CRITICAL/HIGH gate) | |
| run: python3 tools/check-model-sync.py --fail-on-severity HIGH | |
| pack-check: | |
| name: NuGet Pack (dry-run) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Pack | |
| run: > | |
| dotnet pack src/Samsara.Sdk/Samsara.Sdk.csproj | |
| --no-build | |
| --configuration Release | |
| --output ./artifacts | |
| - name: Upload NuGet artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-packages | |
| path: ./artifacts/*.nupkg | |
| retention-days: 7 |