44
55This document explains the GitHub Actions workflows used in the OpenMapView project.
66
7+ > ** Naming Convention:** Reusable workflows are prefixed with an underscore (e.g., ` _docs.yml ` , ` _test.yml ` )
8+ > to distinguish them from caller workflows (e.g., ` ci.yml ` , ` release.yml ` ). This convention
9+ > makes it easy to identify modular components that can be composed into different pipelines.
10+
711## Architecture Overview
812
913The workflows are designed using a ** modular, reusable component architecture** to eliminate code duplication and enable parallel execution.
@@ -69,6 +73,13 @@ Located in `.github/workflows/`:
6973- ** Usage** : Called by daily.yml and ci.yml (PR only)
7074- ** Duration** : ~ 10-15 minutes (may vary due to emulator startup and potential flakiness)
7175
76+ #### ` _docs.yml `
77+ - ** Purpose** : Build API documentation with Dokka
78+ - ** Runs** : ` ./gradlew dokkaGenerate `
79+ - ** Artifacts** : Uploads generated HTML documentation
80+ - ** Usage** : Called by CI for validation and docs-deploy for publishing
81+ - ** Duration** : ~ 1-2 minutes
82+
7283### Main Workflows
7384
7485#### ` ci.yml ` - Continuous Integration
@@ -84,18 +95,19 @@ format (Check formatting)
8495copyright (Check headers)
8596 |
8697 v
87- +----------------+----------------+
88- | |
89- v v
90- test (Unit tests) coverage (Test coverage)
91- | |
92- +----------------+----------------+
93- |
94- +----------------+----------------+
95- | |
96- v v
97- build-library build-examples
98- (Build AAR) (Build 3 APKs)
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)
99111
100112For Pull Requests only:
101113 v
@@ -107,10 +119,11 @@ instrumented-test (Phone + Automotive)
1071191 . ** format** - Runs Spotless formatting check
1081202 . ** copyright** - Verifies MIT license headers
1091213 . ** 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)
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, runs independently)
114127
115128** Total Duration** :
116129- ** Maintainer pushes to main** : ~ 3-4 minutes (no instrumentation tests)
@@ -202,6 +215,50 @@ Phone Tests Automotive Tests
202215- Manual trigger available for on-demand testing
203216- Acceptable flakiness since it doesn't block development workflow
204217
218+ #### ` docs-deploy.yml ` - API Documentation Deployment
219+ ** Trigger** : Push to ` main ` or ` master ` branch (paths: ` openmapview/src/**/*.kt ` , ` README.md ` , ` .github/workflows/_docs.yml ` , ` .github/workflows/docs-deploy.yml ` )
220+
221+ ** Purpose** : Generate API documentation from KDoc comments and deploy to GitHub Pages
222+
223+ ** Execution Flow** :
224+ ```
225+ Push to main (filtered by paths)
226+ |
227+ v
228+ build-docs (calls _docs.yml)
229+ |
230+ v
231+ Build documentation with Dokka
232+ |
233+ v
234+ Upload documentation artifact
235+ |
236+ v
237+ deploy (Download artifact)
238+ |
239+ v
240+ Deploy to GitHub Pages
241+ ```
242+
243+ ** Jobs** :
244+ 1 . ** build-docs** - Calls the reusable ` _docs.yml ` workflow to build documentation
245+ 2 . ** deploy** - Downloads artifact and deploys to GitHub Pages
246+
247+ ** Configuration** :
248+ - Only runs when Kotlin source files or docs workflows change
249+ - Uses concurrency control (only one deployment at a time)
250+ - Requires GitHub Pages to be enabled with "GitHub Actions" as source
251+
252+ ** Total Duration** : ~ 2-3 minutes
253+
254+ ** Published URL** : https://afarber.github.io/OpenMapView/
255+
256+ ** Benefits** :
257+ - Documentation always in sync with code
258+ - Automatic updates on every push to main
259+ - No manual publishing needed
260+ - Professional, searchable API reference
261+
205262## Required GitHub Secrets
206263
207264For the release workflow to function, the project owner must configure these secrets in the GitHub repository:
0 commit comments