- Home
- Skills
- Hitoshura25
- Claude Devtools
- Android Ci Tests
android-ci-tests_skill
- Shell
1
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill hitoshura25/claude-devtools --skill android-ci-tests- SKILL.md8.5 KB
Overview
This skill sets up a GitHub Actions workflow to run Android unit tests, lint, and instrumented tests in CI. It creates a ready-to-use .github/workflows/test.yml with Gradle and AVD caching, JDK setup, and artifact uploads for test results and coverage. The workflow is optimized for speed and reliability and pins actions to commit SHAs for reproducible runs.
How this skill works
The workflow defines three jobs: unit-tests, lint, and instrumented-tests. Each job checks out code, configures JDK 17, restores Gradle caches, sets up Gradle, runs the relevant Gradle tasks, and uploads results as artifacts. The instrumented-tests job uses an Android emulator runner, enables KVM permissions, and caches AVD snapshots to speed up emulator startup. Instrumented tests are configured to run only after unit tests pass.
When to use it
- You have an Android project in a GitHub repository and want CI for tests and lint.
- You need reproducible, pinned-action CI runs with test artifacts available.
- You want faster CI by using Gradle and AVD caching and KVM acceleration.
- You want separate visibility for unit tests, lint, and instrumented tests.
- You plan to add coverage reporting (JaCoCo) or PR test reporting later.
Best practices
- Keep actions pinned to commit SHAs for deterministic CI behavior.
- Enable Gradle and AVD caching to reduce CI time on subsequent runs.
- Only run instrumented tests after unit tests to save CI resources.
- Upload test results and coverage artifacts and set a reasonable retention.
- Tune gradle.properties JVM args (e.g., -Xmx2048m) to avoid OOM failures.
Example use cases
- Automatic unit test runs and artifact uploads on push and pull requests.
- Running lint checks on every commit with results attached to the workflow run.
- Running instrumented UI tests on an emulator using cached AVD snapshots.
- Adding JaCoCo coverage uploads for CI-based coverage tracking.
- Commenting test summaries on PRs using a publish-unit-test-result action.
FAQ
Check runner logs for KVM availability and permissions; the workflow enables KVM rules but GitHub-hosted runners should support KVM.
How do I enable code coverage?
Enable Android test coverage in build.gradle (enableAndroidTestCoverage and enableUnitTestCoverage) and upload JaCoCo reports as artifacts.