-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (80 loc) Β· 3.04 KB
/
Copy pathapps-shared.yml
File metadata and controls
92 lines (80 loc) Β· 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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"