Feature/windows systemic #30
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: apps-shared | |
| # P1/S12 β path-filtered CI lane for the shared KMP core (ADR-010/012). | |
| # Runs the consolidated shared suites (KMP unit + golden-vector tests), enforces | |
| # the Kover coverage floor on the critical packages (net/auth/cache/units/ | |
| # presentation), and gates the OpenAPI contract via the regenerate-and-diff drift | |
| # check plus an optional runtime shape check. Linux runner per ADR-012. | |
| on: | |
| pull_request: | |
| paths: | |
| - 'apps/shared/**' | |
| - 'api/openapi/**' | |
| - 'apps/tools/codegen/**' | |
| - '.github/workflows/apps-shared.yml' | |
| push: | |
| branches: [feat/apps-shared, feature/apps] | |
| paths: | |
| - 'apps/shared/**' | |
| - 'api/openapi/**' | |
| - 'apps/tools/codegen/**' | |
| - '.github/workflows/apps-shared.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: apps-shared-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| shared: | |
| name: Shared KMP (tests + coverage + contract drift) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Set up Node (OpenAPI codegen drift gate) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Shared suites + coverage floor (gradlew :core:allTests koverVerify) | |
| working-directory: apps/shared | |
| run: ./gradlew :core:allTests :core:koverVerify :core:koverLog --no-daemon --console=plain --stacktrace | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apps-shared-coverage | |
| path: | | |
| apps/shared/core/build/reports/kover/report.xml | |
| apps/shared/core/build/reports/kover/html | |
| if-no-files-found: warn | |
| - name: OpenAPI contract drift gate (regenerate + diff) | |
| shell: pwsh | |
| run: ./apps/tools/codegen/gen-clients.ps1 -Check | |
| - name: OpenAPI runtime shape check (optional, BLOCKED if no backend) | |
| shell: pwsh | |
| env: | |
| APPS_SHARED_CONFORMANCE_API_URL: ${{ vars.APPS_SHARED_CONFORMANCE_API_URL }} | |
| run: | | |
| $base = $env:APPS_SHARED_CONFORMANCE_API_URL | |
| if ([string]::IsNullOrWhiteSpace($base)) { | |
| Write-Host "RUNTIME_SHAPE=BLOCKED reason=no test backend reachable (set repo variable APPS_SHARED_CONFORMANCE_API_URL to enable)" | |
| exit 0 | |
| } | |
| $spec = Get-Content 'api/openapi/teslasync.openapi.json' -Raw | ConvertFrom-Json | |
| $url = ($base.TrimEnd('/')) + '/api/v1/system/version' | |
| try { | |
| $resp = Invoke-RestMethod -Uri $url -TimeoutSec 10 | |
| Write-Host "RUNTIME_SHAPE=OK probed=$url" | |
| } catch { | |
| Write-Host "RUNTIME_SHAPE=BLOCKED reason=backend configured but unreachable ($url): $($_.Exception.Message)" | |
| exit 0 | |
| } | |
| - name: CI honesty marker | |
| if: success() | |
| run: echo "EXIT=0" |