@@ -38,6 +38,13 @@ Located in `.github/workflows/`:
3838- ** Usage** : Called by CI and Release workflows
3939- ** Fast** : ~ 30 seconds
4040
41+ #### ` _detekt.yml `
42+ - ** Purpose** : Run Detekt static code analysis
43+ - ** Runs** : ` ./gradlew detekt `
44+ - ** Usage** : Called by CI and Release workflows
45+ - ** Duration** : ~ 1-2 minutes
46+ - ** Reports** : HTML, XML, and SARIF reports generated
47+
4148#### ` _coverage.yml `
4249- ** Purpose** : Check test coverage meets minimum threshold
4350- ** Runs** : ` ./scripts/check-coverage.sh ` (minimum threshold defined in [ Contributing Guide] ( CONTRIBUTING.md#test-coverage ) )
@@ -89,41 +96,26 @@ Located in `.github/workflows/`:
8996
9097** Execution Flow** :
9198```
92- format (Check formatting)
93- |
94- v
95- copyright (Check headers)
96- |
97- v
98- +----------------+----------------+----------------+
99- | | |
100- v v v
101- test docs coverage
102- (Unit tests) (Build API docs) (Test coverage)
103- | | |
104- +----------------+----------------+----------------+
105- |
106- +--------------------------+-------------------------+
107- | |
108- v v
109- build-library build-examples
110- (Build AAR) (Build 3 APKs)
99+ format ────┐
100+ │
101+ copyright ─┼──→ test/coverage/docs ──→ build-library
102+ │ │
103+ detekt ────┘ └──→ build-examples
111104
112105For Pull Requests only:
113- v
114- instrumented-test (Phone + Automotive)
115- (Runs in parallel, not blocking)
106+ instrumented-test (Phone + Automotive) runs in parallel
116107```
117108
118109** Jobs** :
1191101 . ** format** - Runs Spotless formatting check
1201112 . ** copyright** - Verifies MIT license headers
121- 3 . ** test** - Runs unit tests (depends on format + copyright)
122- 4 . ** docs** - Builds API documentation with Dokka (depends on format + copyright)
123- 5 . ** coverage** - Checks test coverage meets 20% minimum (depends on format + copyright)
124- 6 . ** build-library** - Builds library AAR (depends on format + copyright + test + docs + coverage, runs in parallel with build-examples)
125- 7 . ** build-examples** - Builds example APKs (depends on format + copyright + test + docs + coverage, runs in parallel with build-library)
126- 8 . ** instrumented-test** - Runs instrumentation tests on phone and automotive emulators (PR only, required status check)
112+ 3 . ** detekt** - Runs Detekt static code analysis
113+ 4 . ** test** - Runs unit tests (depends on format + copyright + detekt)
114+ 5 . ** docs** - Builds API documentation with Dokka (depends on format + copyright + detekt)
115+ 6 . ** coverage** - Checks test coverage meets 20% minimum (depends on format + copyright + detekt)
116+ 7 . ** build-library** - Builds library AAR (depends on all above, runs in parallel with build-examples)
117+ 8 . ** build-examples** - Builds example APKs (depends on all above, runs in parallel with build-library)
118+ 9 . ** instrumented-test** - Runs instrumentation tests on phone and automotive emulators (PR only)
127119
128120** Total Duration** :
129121- ** Maintainer pushes to main** : ~ 3-4 minutes (no instrumentation tests)
@@ -143,30 +135,19 @@ instrumented-test (Phone + Automotive)
143135
144136** Execution Flow** :
145137```
146- format (Check formatting)
147- |
148- v
149- test (Run unit tests)
150- |
151- v
152- +----------------+----------------+
153- | |
154- v v
155- build-library build-examples
156- | |
157- +-----------------+---------------+
158- |
159- v
160- publish
161- (Maven Central + GitHub Release)
138+ format ────┐
139+ ├──→ test ──→ build-library ──┐
140+ detekt ────┘ │ ├──→ publish
141+ └──→ build-examples ──┘
162142```
163143
164144** Jobs** :
1651451 . ** format** - Runs Spotless formatting check
166- 2 . ** test** - Runs unit tests (depends on format)
167- 3 . ** build-library** - Builds library AAR (depends on format + test)
168- 4 . ** build-examples** - Builds example APKs (depends on format + test)
169- 5 . ** publish** - Publishes to Maven Central and creates GitHub Release (depends on all above)
146+ 2 . ** detekt** - Runs Detekt static code analysis
147+ 3 . ** test** - Runs unit tests (depends on format + detekt)
148+ 4 . ** build-library** - Builds library AAR (depends on format + detekt + test)
149+ 5 . ** build-examples** - Builds example APKs (depends on format + detekt + test)
150+ 6 . ** publish** - Publishes to Maven Central and creates GitHub Release (depends on all above)
170151
171152** Publish Job Details** :
172153- Validates tag format (must be ` vMAJOR.MINOR.PATCH ` )
@@ -310,6 +291,9 @@ Before pushing, developers can run the same checks locally:
310291# Auto-fix formatting
311292./gradlew spotlessApply
312293
294+ # Static analysis
295+ ./gradlew detekt
296+
313297# Run unit tests
314298./gradlew :openmapview:test
315299
@@ -375,6 +359,7 @@ Artifacts are retained for 30 days.
375359
376360** Common Failures** :
377361- ** Format check fails** : Run ` ./gradlew spotlessApply ` locally and commit
362+ - ** Detekt fails** : Run ` ./gradlew detekt ` locally to see issues
378363- ** Test fails** : Run ` ./gradlew :openmapview:test ` locally to debug
379364- ** Build fails** : Check for compilation errors in logs
380365- ** Publish fails** : Verify GitHub Secrets are configured correctly
@@ -390,34 +375,19 @@ Developer creates PR with code changes
390375GitHub triggers ci.yml workflow
391376 |
392377 v
393- format job: Check Spotless formatting (30 sec) - PASS
378+ format/copyright/detekt jobs run in parallel (30-60 sec each ) - PASS
394379 |
395380 v
396- copyright job: Check license headers (30 sec) - PASS
381+ test/coverage/docs jobs run (1-2 min each) - PASS
382+ |
383+ v
384+ build-library + build-examples run in parallel (2-3 min) - PASS
397385 |
398386 v
399- +-------------+--------------+
400- | |
401- v v
402- test job: Unit tests coverage job: Test coverage
403- (1 min) - PASS (1 min) - PASS (>20%)
404- | |
405- +-------------+--------------+
406- |
407- +-------------+--------------+
408- | |
409- v v
410- build-library: Build AAR build-examples: Build 3 APKs
411- (2 min) - PASS (3 min) - PASS
412- | |
413- +-------------+--------------+
414- |
415- v
416387All core checks pass (3-4 min)
417388
418389Meanwhile (in parallel, PR only):
419- instrumented-test: Phone + Automotive tests
420- (10-15 min) - PASS
390+ instrumented-test: Phone + Automotive tests (10-15 min) - PASS
421391 |
422392 v
423393All checks complete -> PR is ready to merge
@@ -432,21 +402,15 @@ Developer tags v0.2.0 and pushes
432402GitHub triggers release.yml workflow
433403 |
434404 v
435- format job: Check Spotless formatting - PASS
405+ format + detekt jobs run in parallel - PASS
436406 |
437407 v
438408test job: Run unit tests - PASS
439409 |
440410 v
441- +-------------+--------------+
442- | |
443- v v
444- build-library: Build AAR build-examples: Build 3 APKs
445- - PASS - PASS
446- | |
447- +-------------+--------------+
448- |
449- v
411+ build-library + build-examples run in parallel - PASS
412+ |
413+ v
450414publish job:
451415 - Validate tag format - PASS
452416 - Sign artifacts with GPG - PASS
0 commit comments