Feature/ci pipeline#55
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive CI pipeline using GitHub Actions for automated Android project builds and testing on every PR and push to main. The implementation includes code quality tools and coverage reporting to ensure consistent code standards.
- Added GitHub Actions workflows with build automation, unit testing, and code coverage using JaCoCo
- Configured Detekt for Kotlin code linting and quality checks
- Updated Gradle dependencies and plugin configurations to support the CI pipeline
Reviewed Changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/ci.yml | Comprehensive CI workflow with build, test, coverage, and linting steps |
| .github/workflows/android.yml | Basic Android build workflow |
| app/build.gradle.kts | Added JaCoCo plugin and coverage reporting configuration |
| settings.gradle.kts | Reordered repository declarations for better resolution |
| gradle.properties | Removed hardcoded JDK path for better CI compatibility |
| pull_request: | ||
| branches: [ main ] | ||
| push: | ||
| branches: [ main, feature/ci-pipeline ] |
There was a problem hiding this comment.
The feature branch 'feature/ci-pipeline' should not be included in the push trigger for production CI. This should only include stable branches like 'main'.
| branches: [ main, feature/ci-pipeline ] | |
| branches: [ main ] |
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v3 |
There was a problem hiding this comment.
This workflow uses outdated action versions (checkout@v3, setup-java@v3) while ci.yml uses newer versions (v4). Consider updating to match the newer workflow or removing this duplicate workflow entirely.
| uses: actions/checkout@v3 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 |
| - name: Run Detekt (Kotlin Linter) | ||
| run: ./gradlew detekt | ||
|
|
||
| - name: Upload Detekt Report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: detekt-report | ||
| path: build/reports/detekt |
There was a problem hiding this comment.
The detekt task is being executed without the detekt plugin being configured in the build.gradle.kts file. This will cause the CI to fail as the task doesn't exist.
| - name: Run Detekt (Kotlin Linter) | |
| run: ./gradlew detekt | |
| - name: Upload Detekt Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: detekt-report | |
| path: build/reports/detekt | |
| # Detekt steps removed because the Detekt plugin is not configured in build.gradle.kts. |
| val debugTree = fileTree("${buildDir}/intermediates/javac/debug/classes") { | ||
| exclude(fileFilter) | ||
| } | ||
|
|
||
| val kotlinDebugTree = fileTree("${buildDir}/tmp/kotlin-classes/debug") { | ||
| exclude(fileFilter) | ||
| } | ||
|
|
||
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | ||
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | ||
| executionData.setFrom(fileTree(buildDir) { |
There was a problem hiding this comment.
Using deprecated 'buildDir' property. Should use 'layout.buildDirectory.get().asFile' instead for Gradle 7+ compatibility.
| val debugTree = fileTree("${buildDir}/intermediates/javac/debug/classes") { | |
| exclude(fileFilter) | |
| } | |
| val kotlinDebugTree = fileTree("${buildDir}/tmp/kotlin-classes/debug") { | |
| exclude(fileFilter) | |
| } | |
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | |
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | |
| executionData.setFrom(fileTree(buildDir) { | |
| val debugTree = fileTree(layout.buildDirectory.get().asFile.resolve("intermediates/javac/debug/classes")) { | |
| exclude(fileFilter) | |
| } | |
| val kotlinDebugTree = fileTree(layout.buildDirectory.get().asFile.resolve("tmp/kotlin-classes/debug")) { | |
| exclude(fileFilter) | |
| } | |
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | |
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | |
| executionData.setFrom(fileTree(layout.buildDirectory.get().asFile) { |
| val debugTree = fileTree("${buildDir}/intermediates/javac/debug/classes") { | ||
| exclude(fileFilter) | ||
| } | ||
|
|
||
| val kotlinDebugTree = fileTree("${buildDir}/tmp/kotlin-classes/debug") { | ||
| exclude(fileFilter) | ||
| } | ||
|
|
||
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | ||
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | ||
| executionData.setFrom(fileTree(buildDir) { |
There was a problem hiding this comment.
Using deprecated 'buildDir' property. Should use 'layout.buildDirectory.get().asFile' instead for Gradle 7+ compatibility.
| val debugTree = fileTree("${buildDir}/intermediates/javac/debug/classes") { | |
| exclude(fileFilter) | |
| } | |
| val kotlinDebugTree = fileTree("${buildDir}/tmp/kotlin-classes/debug") { | |
| exclude(fileFilter) | |
| } | |
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | |
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | |
| executionData.setFrom(fileTree(buildDir) { | |
| val debugTree = fileTree("${layout.buildDirectory.get().asFile}/intermediates/javac/debug/classes") { | |
| exclude(fileFilter) | |
| } | |
| val kotlinDebugTree = fileTree("${layout.buildDirectory.get().asFile}/tmp/kotlin-classes/debug") { | |
| exclude(fileFilter) | |
| } | |
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | |
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | |
| executionData.setFrom(fileTree(layout.buildDirectory.get().asFile) { |
| val debugTree = fileTree("${buildDir}/intermediates/javac/debug/classes") { | ||
| exclude(fileFilter) | ||
| } | ||
|
|
||
| val kotlinDebugTree = fileTree("${buildDir}/tmp/kotlin-classes/debug") { | ||
| exclude(fileFilter) | ||
| } | ||
|
|
||
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | ||
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | ||
| executionData.setFrom(fileTree(buildDir) { |
There was a problem hiding this comment.
Using deprecated 'buildDir' property. Should use 'layout.buildDirectory.get().asFile' instead for Gradle 7+ compatibility.
| val debugTree = fileTree("${buildDir}/intermediates/javac/debug/classes") { | |
| exclude(fileFilter) | |
| } | |
| val kotlinDebugTree = fileTree("${buildDir}/tmp/kotlin-classes/debug") { | |
| exclude(fileFilter) | |
| } | |
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | |
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | |
| executionData.setFrom(fileTree(buildDir) { | |
| val debugTree = fileTree("${layout.buildDirectory.get().asFile}/intermediates/javac/debug/classes") { | |
| exclude(fileFilter) | |
| } | |
| val kotlinDebugTree = fileTree("${layout.buildDirectory.get().asFile}/tmp/kotlin-classes/debug") { | |
| exclude(fileFilter) | |
| } | |
| classDirectories.setFrom(files(debugTree, kotlinDebugTree)) | |
| sourceDirectories.setFrom(files("src/main/java", "src/main/kotlin")) | |
| executionData.setFrom(fileTree(layout.buildDirectory.get().asFile) { |
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: detekt-report | ||
| path: build/reports/detekt |
There was a problem hiding this comment.
The detekt reports path should likely be 'app/build/reports/detekt' to match the project structure, as detekt would run on the app module.
| path: build/reports/detekt | |
| path: app/build/reports/detekt |
|
@gaurigupta0604 kindly check into this suggestions by @copilot |
This PR adds a CI pipeline using GitHub Actions for the Android project. The goal is to automate the build and testing process so that it runs on every PR and push to
main.What's been added:
assembleDebug)testDebugUnitTest)Let me know if there's anything I missed or should change. :)