@@ -22,12 +22,25 @@ The workflows are designed using a **modular, reusable component architecture**
2222
2323Located in ` .github/workflows/ ` :
2424
25+ #### ` _copyright.yml `
26+ - ** Purpose** : Verify MIT license headers in all ` .kt ` files
27+ - ** Runs** : ` ./scripts/check-copyright.sh `
28+ - ** Usage** : Called by CI and Release workflows
29+ - ** Fast** : ~ 30 seconds
30+
2531#### ` _format.yml `
2632- ** Purpose** : Verify code formatting with Spotless
2733- ** Runs** : ` ./gradlew spotlessCheck `
2834- ** Usage** : Called by CI and Release workflows
2935- ** Fast** : ~ 30 seconds
3036
37+ #### ` _coverage.yml `
38+ - ** Purpose** : Check test coverage meets minimum threshold
39+ - ** Runs** : ` ./scripts/check-coverage.sh ` (minimum 20% coverage)
40+ - ** Artifacts** : Uploads coverage reports to Codecov and as artifacts
41+ - ** Usage** : Called by CI workflow
42+ - ** Duration** : ~ 1-2 minutes
43+
3144#### ` _test.yml `
3245- ** Purpose** : Run unit tests
3346- ** Runs** : ` ./gradlew :openmapview:test --continue `
@@ -49,6 +62,13 @@ Located in `.github/workflows/`:
4962- ** Usage** : Called by CI and Release workflows
5063- ** Duration** : ~ 3-4 minutes
5164
65+ #### ` _instrumentation.yml `
66+ - ** Purpose** : Run instrumentation tests on Android emulators
67+ - ** Runs** : Tests on both phone (Nexus 6) and automotive (automotive_1024p_landscape) profiles
68+ - ** Artifacts** : Uploads test results and reports for both device types
69+ - ** Usage** : Called by daily.yml and ci.yml (PR only)
70+ - ** Duration** : ~ 10-15 minutes (may vary due to emulator startup and potential flakiness)
71+
5272### Main Workflows
5373
5474#### ` ci.yml ` - Continuous Integration
@@ -61,28 +81,47 @@ Located in `.github/workflows/`:
6181format (Check formatting)
6282 |
6383 v
64- test (Run unit tests )
84+ copyright (Check headers )
6585 |
6686 v
6787 +----------------+----------------+
6888 | |
6989 v v
90+ test (Unit tests) coverage (Test coverage)
91+ | |
92+ +----------------+----------------+
93+ |
94+ +----------------+----------------+
95+ | |
96+ v v
7097build-library build-examples
7198(Build AAR) (Build 3 APKs)
99+
100+ For Pull Requests only:
101+ v
102+ instrumented-test (Phone + Automotive)
103+ (Runs in parallel, not blocking)
72104```
73105
74106** Jobs** :
751071 . ** format** - Runs Spotless formatting check
76- 2 . ** test** - Runs unit tests (depends on format)
77- 3 . ** build-library** - Builds library AAR (depends on format + test, runs in parallel with build-examples)
78- 4 . ** build-examples** - Builds example APKs (depends on format + test, runs in parallel with build-library)
108+ 2 . ** copyright** - Verifies MIT license headers
109+ 3 . ** test** - Runs unit tests (depends on format + copyright)
110+ 4 . ** coverage** - Checks test coverage meets 20% minimum (depends on format + copyright)
111+ 5 . ** build-library** - Builds library AAR (depends on format + copyright + test + coverage, runs in parallel with build-examples)
112+ 6 . ** build-examples** - Builds example APKs (depends on format + copyright + test + coverage, runs in parallel with build-library)
113+ 7 . ** instrumented-test** - Runs instrumentation tests on phone and automotive emulators (PR only, runs independently)
79114
80- ** Total Duration** : ~ 3-4 minutes (with parallel builds)
115+ ** Total Duration** :
116+ - ** Maintainer pushes to main** : ~ 3-4 minutes (no instrumentation tests)
117+ - ** External PRs** : ~ 10-15 minutes (includes instrumentation tests on phone + automotive)
81118
82119** Benefits** :
83120- Catches formatting issues early (before expensive builds)
84121- Parallel builds save time
85122- PR checks ensure code quality before merge
123+ - Instrumentation tests only run on PRs, reducing CI time for maintainer's direct commits
124+ - External contributors' PRs are thoroughly tested on both phone and automotive platforms
86125
87126#### ` release.yml ` - Maven Central Release
88127** Trigger** : Push of version tag matching ` v*.*.* ` pattern (e.g., ` v0.2.0 ` )
@@ -131,6 +170,38 @@ build-library build-examples
131170
132171** Secrets Required** : See "Required GitHub Secrets" section below
133172
173+ #### ` daily.yml ` - Daily Instrumentation Tests
174+ ** Trigger** : Scheduled daily at 09:45 UTC, or manual trigger via workflow_dispatch
175+
176+ ** Purpose** : Run comprehensive instrumentation tests on both phone and automotive platforms daily to catch potential issues early
177+
178+ ** Execution Flow** :
179+ ```
180+ Scheduled trigger (09:45 UTC daily)
181+ |
182+ v
183+ instrumented-test (calls _instrumentation.yml)
184+ |
185+ v
186+ +------------------+------------------+
187+ | |
188+ v v
189+ Phone Tests Automotive Tests
190+ (Nexus 6 profile) (automotive_1024p_landscape)
191+ ```
192+
193+ ** Jobs** :
194+ 1 . ** instrumented-test** - Calls the reusable ` _instrumentation.yml ` workflow
195+
196+ ** Total Duration** : ~ 10-15 minutes (may vary due to emulator startup and flakiness)
197+
198+ ** Benefits** :
199+ - Catches device-specific regressions early
200+ - Tests on both phone and automotive form factors
201+ - Runs independently from main CI pipeline
202+ - Manual trigger available for on-demand testing
203+ - Acceptable flakiness since it doesn't block development workflow
204+
134205## Required GitHub Secrets
135206
136207For the release workflow to function, the project owner must configure these secrets in the GitHub repository:
@@ -266,19 +337,34 @@ GitHub triggers ci.yml workflow
266337format job: Check Spotless formatting (30 sec) - PASS
267338 |
268339 v
269- test job: Run unit tests (1 min ) - PASS
340+ copyright job: Check license headers (30 sec ) - PASS
270341 |
271342 v
272343 +-------------+--------------+
273344 | |
274345 v v
346+ test job: Unit tests coverage job: Test coverage
347+ (1 min) - PASS (1 min) - PASS (>20%)
348+ | |
349+ +-------------+--------------+
350+ |
351+ +-------------+--------------+
352+ | |
353+ v v
275354build-library: Build AAR build-examples: Build 3 APKs
276355 (2 min) - PASS (3 min) - PASS
277356 | |
278357 +-------------+--------------+
279358 |
280359 v
281- All checks pass -> PR is ready to merge
360+ All core checks pass (3-4 min)
361+
362+ Meanwhile (in parallel, PR only):
363+ instrumented-test: Phone + Automotive tests
364+ (10-15 min) - PASS (may be flaky)
365+ |
366+ v
367+ All checks complete -> PR is ready to merge
282368```
283369
284370### Example: Release to Maven Central
@@ -331,15 +417,22 @@ To upgrade Java version or change Gradle cache settings:
331417- Automatically applies to CI and Release workflows
332418
333419### 4. Composability
334- Easy to add new workflows :
420+ The reusable ` _instrumentation.yml ` workflow demonstrates this principle :
335421``` yaml
336- # Future: instrumentation-tests .yml
422+ # Used by both daily.yml and ci .yml
337423jobs :
338424 instrumentation-tests :
339- uses : ./.github/workflows/_instrumentation-tests .yml
425+ uses : ./.github/workflows/_instrumentation.yml
340426` ` `
427+ This single workflow definition powers both daily scheduled tests and PR validation tests.
428+
429+ ### 5. Flexible Testing Strategy
430+ - **Maintainer commits to main**: Fast feedback (~3-4 min) without instrumentation delays
431+ - **External PRs**: Comprehensive testing (~10-15 min) including phone and automotive instrumentation tests
432+ - **Daily scheduled runs**: Proactive regression detection on both platforms
433+ - **Test flakiness handled gracefully**: Instrumentation tests run independently and don't block merges
341434
342- ### 5 . Clear Separation of Concerns
435+ ### 6 . Clear Separation of Concerns
343436- Format checks catch simple issues fast
344437- Tests verify correctness
345438- Builds ensure compilation works
0 commit comments