Skip to content

Add CI: lint, test and build checks for Android and iOS - #20

Merged
kirillinoz merged 1 commit into
mainfrom
ci-lint-test-build
Aug 15, 2026
Merged

kirillinoz merged 1 commit into
mainfrom
ci-lint-test-build

Conversation

@kirillinoz

Copy link
Copy Markdown
Collaborator

Every PR now gets checked for formatting, tests, and that both platforms build, in two parallel jobs — lint-test-android on ubuntu-latest (Spotless/ktlint, JVM tests, debug APK) and ios on macos-latest (swift-format, iOS simulator tests, framework link for simulator + device) — with the same checks runnable locally via make check / make ci.

Kotlin formatting is ratcheted to origin/main, so both spotlessCheck and spotlessApply only ever touch files that differ from it: the baseline is green with no repo-wide reformat commit to conflict with in-flight branches, and format debt is paid down file by file as code is naturally edited. CI only ever checks — there is no spotlessApply, no --in-place and no auto-commit anywhere in the workflow, so unformatted code fails the PR and the contributor runs make format.

.editorconfig disables the three ktlint rules whose violations ktlint cannot auto-fix (function-naming, property-naming, kdoc), since leaving them on would break spotlessApply rather than just the check; .swift-format spells out its rules block in full because swift-format treats a missing key as false and a partial block silently turns lint into a no-op. No secrets are needed — generateSupabaseConfig falls back to placeholders and SupabaseIntegrationTest self-skips.

Verified locally: make check and make ci both green (125 JVM tests, 126 iOS tests, APK produced, both frameworks linked), plus the lint-fails → format → lint-passes round trip.

🤖 Generated with Claude Code

Every pull request now gets checked for formatting, tests, and that both
platforms build — with the same checks runnable locally from one command.

Kotlin formatting is Spotless + ktlint, ratcheted to origin/main. The ratchet
is the core of the design: it limits both spotlessCheck and spotlessApply to
files that differ from origin/main, so the baseline is green on day one with no
repo-wide reformat commit (which would have conflicted with every branch in
flight) and format debt is paid down file by file as code is naturally touched.
CI must therefore check out with fetch-depth: 0, and fetches origin/main by
name, or the ratchet cannot resolve its base ref.

.editorconfig disables the three ktlint rules that report violations ktlint
cannot auto-fix — function-naming (Composables are PascalCase), property-naming
(so are private design-token constants) and kdoc (dangling file-level KDoc).
Leaving any of them on would break spotlessApply, not just spotlessCheck.

Swift uses swift-format, which ships inside Xcode, so there is nothing to
install. Its `rules` block is written out in full rather than as a delta:
swift-format treats a missing key as false, so a partial block silently
disables every rule it omits and turns lint into a no-op. Only
TypeNamesShouldBeCapitalized is changed from the default, for `iOSApp`.

CI only ever checks. There is no spotlessApply, no --in-place and no
auto-commit step anywhere in the workflow; applying formatting is the
contributor's job, locally.

Verified locally: make check and make ci both green (125 JVM tests, 126 iOS
tests, debug APK produced, both frameworks linked), and the lint-fails →
format → lint-passes round trip works.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kirillinoz kirillinoz self-assigned this Aug 15, 2026
@kirillinoz
kirillinoz merged commit b06155e into main Aug 15, 2026
2 checks passed
@kirillinoz
kirillinoz deleted the ci-lint-test-build branch August 15, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant