-
Notifications
You must be signed in to change notification settings - Fork 4
Update actions #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update actions #70
Changes from all commits
cc9b6ab
ff1d0dc
d177211
7bb16c4
e2e707d
062bc57
9f33989
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,20 @@ android { | |||||||||||||||||||||||||||||||||||||
| "proguard-rules.pro" | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| // Optimize debug builds for CI | ||||||||||||||||||||||||||||||||||||||
| //See if i can add this to build Logic | ||||||||||||||||||||||||||||||||||||||
| debug { | ||||||||||||||||||||||||||||||||||||||
| isMinifyEnabled = false | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // Disable BuildConfig generation for library (not needed, saves build time) | ||||||||||||||||||||||||||||||||||||||
| //See if i can add this to build Logic | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+43
to
+50
|
||||||||||||||||||||||||||||||||||||||
| //See if i can add this to build Logic | |
| debug { | |
| isMinifyEnabled = false | |
| } | |
| } | |
| // Disable BuildConfig generation for library (not needed, saves build time) | |
| //See if i can add this to build Logic | |
| // TODO: See if this can be added to build logic. | |
| debug { | |
| isMinifyEnabled = false | |
| } | |
| } | |
| // Disable BuildConfig generation for library (not needed, saves build time) | |
| // TODO: See if this can be added to build logic. |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same capitalization and punctuation issue as the previous comment. Should be '// TODO: See if this can be added to build logic'.
| //See if i can add this to build Logic | |
| // TODO: See if this can be added to build logic |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # CI Build Time Optimization Guide | ||
|
|
||
| ## 🔧 Additional Optimizations to be applied | ||
|
|
||
| ### **1. Skip Unnecessary Tasks** | ||
|
|
||
| Add to `build.gradle.kts`: | ||
|
|
||
| ```kotlin | ||
| tasks.withType<JavaCompile>().configureEach { | ||
| options.isIncremental = true | ||
| } | ||
|
|
||
| // Skip tasks not needed in CI | ||
| tasks.matching { | ||
| it.name.startsWith("generate") && | ||
| it.name.endsWith("BuildConfig") | ||
| }.configureEach { | ||
| enabled = !System.getenv("CI").toBoolean() | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| ### **3. Optimize Dependencies** | ||
|
|
||
| ```kotlin | ||
| // Use implementation instead of api when possible | ||
| implementation(libs.androidx.core.ktx) // ✅ Better | ||
| api(libs.androidx.core.ktx) // ❌ Slower (forces recompilation) | ||
|
|
||
| // Use compileOnly for large dependencies not needed at runtime | ||
| compileOnly(libs.some.large.library) | ||
| ``` | ||
|
|
||
| ### **4. Enable R8/ProGuard Optimization in CI** | ||
|
|
||
| ```kotlin | ||
| buildTypes { | ||
| debug { | ||
| // Disable minification in debug for faster CI builds | ||
| isMinifyEnabled = false | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 🎯 Monitoring Build Performance | ||
|
|
||
|
|
||
| ## 🔍 Troubleshooting | ||
|
|
||
| ### **Build slower after optimization?** | ||
|
|
||
| **Check:** | ||
|
|
||
| 1. Configuration cache warnings: `./gradlew --configuration-cache help` | ||
| 2. Gradle cache hits: Look for "FROM-CACHE" in logs | ||
| 3. Parallel execution: Check if tasks run simultaneously | ||
|
|
||
| **Common issues:** | ||
|
|
||
| - Configuration cache problems with custom plugins | ||
| - Tasks not cacheable (check `@CacheableTask` annotations) | ||
| - Too many workers (reduce if memory issues) | ||
|
|
||
| ### **Configuration cache errors?** | ||
|
|
||
| ```bash | ||
| # Locally test configuration cache | ||
| ./gradlew clean build --configuration-cache | ||
|
|
||
| # If errors, disable temporarily | ||
| ./gradlew build --no-configuration-cache | ||
| ``` | ||
|
|
||
| ### **Out of memory errors?** | ||
|
|
||
| Increase memory in `ci-gradle.properties`: | ||
|
|
||
| ```properties | ||
| org.gradle.jvmargs=-Xmx6144m # Increase from 4GB to 6GB | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 📈 Future Improvements | ||
|
|
||
| Consider these for even faster builds: | ||
|
|
||
| - [ ] **Split workflows**: Separate lint/test/build into different workflow files | ||
| - [ ] **Matrix builds**: Build multiple variants in parallel | ||
|
|
||
| --- | ||
|
|
||
| ## 🎓 Learn More | ||
|
|
||
| - [Gradle Performance Guide](https://docs.gradle.org/current/userguide/performance.html) | ||
| - [Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache.html) | ||
| - [GitHub Actions Optimization](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows) | ||
| - [Android Build Performance](https://developer.android.com/studio/build/optimize-your-build) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache-encryption-key parameter is being added but relies on a GitHub secret (GRADLE_ENCRYPTION_KEY) that may not be configured. If this secret is not set up in the repository settings, the workflow will fail or the cache encryption feature will not work as intended. Ensure this secret is properly configured before merging, or consider making this parameter conditional.