ronjunevaldoz/kmp-agent-skills/kmp-ci-github-actions
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Sets up GitHub Actions CI for a Kotlin Multiplatform (KMP) project. Produces two workflow files: ci.yml (lint, Android tests, iOS tests, Desktop JVM tests, Web JS + WasmJs tests, Gradle cache) and release.yml (XCFramework build + upload artifact). All target platforms are covered. Assumes AGP 9+ and the project structure from kmp-feature-scaffold. Optional third workflow comments before/after screenshot tables on pull requests (PR) from committed snapshot goldens.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-ci-github-actionsSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-ci-github-actions.
When to Use This Skill
Use when you need to:
- Set up GitHub Actions CI for a new or existing KMP project
- Add automated Android, iOS, Desktop, or Web test jobs
- Configure a release workflow that builds and publishes an XCFramework
- Wire Gradle caching into CI for faster builds
Requires: kmp-feature-scaffold project structure (or equivalent AGP 9+ KMP layout).
Trigger keywords: set up CI, GitHub Actions, CI pipeline, automated tests, build workflow, release workflow, KMP CI, XCFramework release, Gradle cache CI, PR checks, continuous integration, continuous delivery, CD pipeline, GitHub workflow YAML, automate build, merge checks, branch protection, automated release, deploy workflow, CI is red, CI failing, GitHub Actions minutes, free tier CI, run CI locally, act local runner, koverVerify, test coverage CI, coverage gate, PR screenshot comment, before/after comment.
Freshness rule: GitHub Actions runner images and actions/setup-java / gradle/actions versions change frequently — recheck pinned versions and runs-on labels before using this skill in a new project.
Recommendation First
Default to two workflow files: `ci.yml` (PR matrix) + `release.yml` (tag-triggered XCFramework).
Why:
- per-target jobs (Android, iOS, Desktop, Web) run in parallel and give clear failure attribution
- a separate release workflow keeps tag-triggered publishing decoupled from PR validation
- Gradle cache restore/save steps are critical — without them, KMP CI is prohibitively slow
Set up Gradle caching and the actions/setup-java step before anything else. Skip platform jobs only when the product explicitly excludes that target.
Overview
Two workflow files:
| File | Trigger | Jobs | |
|---|---|---|---|
.github/workflows/ci.yml | push to main, all PRs | lint, test-android, test-ios, test-desktop, test-web | |
.github/workflows/release.yml | push tag v* | build-xcframework | |
.github/workflows/pr-visual-evidence.yml (optional) | PRs touching **/snapshots/** | comment |
Step 1: Create .github/workflows/ci.yml
Step 2: Release Workflow
Full content: references/release-workflow.md.
Step 3: Gradle configuration for CI
Add to gradle.properties:
Add to root build.gradle.kts — ensures all modules report test results in a CI-friendly format:
Surface compiler warnings in the PR check
Ktlint/Detekt never see real compiler warnings (deprecated calls, unchecked casts) — those only exist in ./gradlew build output and are otherwise buried in logs no one reads. Capture and surface them, non-blocking, until allWarningsAsErrors (see code-quality's Compiler Warnings section) is ready to gate on it:
Step 4: Required GitHub secrets
Add these in Settings → Secrets and variables → Actions:
| Secret | Purpose | |
|---|---|---|
GRADLE_ENCRYPTION_KEY | Encrypts the Gradle build cache. Generate with: openssl rand -base64 16 |
No other secrets are required for a public repo. For private repos, GITHUB_TOKEN is auto-provided.
Step 5: Enable Gradle build cache on CI
The gradle/actions/setup-gradle@v4 action automatically:
- Caches
~/.gradle/cachesbetween runs keyed on dependency hash - Uploads/restores the Gradle configuration cache
- Reports cache hit/miss in the Actions summary
No extra actions/cache step is needed.
Step 6: XCFramework Gradle config (shared module)
Ensure :shared (or your main shared KMP module) configures the XCFramework in its build.gradle.kts:
The assembleReleaseXCFramework task is auto-generated by the KMP plugin.
Step 7 (Optional): Before/After Screenshot Comment on PRs
Full content: references/pr-visual-evidence-workflow.md. Posts or updates one PR comment with a Before | After table for changed committed snapshot PNGs, using kmp-roborazzi/scripts/pr_visual_evidence.py. git + gh only, no Gradle, runs in seconds. Not a required check.
Guidelines
- Always use
concurrencywithcancel-in-progress: trueon CI to cancel stale PR runs - Run
lintas a gate before tests — fail fast on obvious issues - Use
macos-latestonly for iOS jobs (billable minutes ~10× more than Ubuntu) - Android, Desktop, and Web tests all run on
ubuntu-latest— fast and cheap - Use
gradle/actions/setup-gradle@v4— it supersedes the oldergradle/gradle-build-action - Never store secrets in
gradle.properties— use GitHub secrets and inject viaenv: - Set
retention-dayson artifacts to avoid storage accumulation
Verification
- Open a draft PR — confirm
lint,test-android,test-ios,test-desktop,test-weball trigger - Push a
v0.0.1tag — confirmbuild-xcframeworktriggers and artifact appears in release - Check Actions summary for Gradle cache hit rates after the second run
Free-Tier Minutes Exhaustion — Recognizing and Reducing It
GitHub's free tier for private repos gives 2,000 CI minutes/month, and macOS runners bill at a 10× multiplier — so test-ios alone can burn quota roughly 10x faster than the Linux jobs. A project pushing frequently can exhaust that in a normal month.
How it actually shows up: not a clear "quota exceeded" error on the failing job itself — the run gets cancelled or fails to start, and GitHub's own banner (checked at https://github.com/<org>/<repo>/settings/billing, or the "This job was not started because recent account payments have failed or your spending limit needs to be increased" banner on the run page) is the actual signal, not the job's own logs. If a run is red with no clear error in the job step output itself, check billing before assuming the workflow broke.
Reduce it:
paths-ignoreon the workflow'son:trigger for docs-only changes (**.md,
docs/**) — no code changed, no reason to burn minutes
- Confirm the macOS/iOS job stays on the required per-push gate only if iOS
regressions are actually common; consider moving it to a nightly/opt-in schedule the same way the full device/simulator matrix already is in kmp-roborazzi, if push-frequency cost is the real problem
- Dry-run locally before pushing (see next section) — catches a broken workflow or a
failing Linux job without spending any GitHub Actions minutes at all
Verifying a Workflow Locally Before Pushing
scripts/install-act.sh installs `act` (brew install act) — runs the actual workflow YAML locally via Docker, catching a broken step before it costs a real CI run. Never touches GitHub, uses zero minutes.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-ci-github-actions/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ronjunevaldoz/kmp-agent-skills/kmp-ci-github-actions)