Skip to content

Conversation

Copy link

Copilot AI commented Sep 27, 2025

This PR updates the Android CI workflow (android.yml) to improve build performance and code quality by removing instrumented tests and adding lint checking with automatic PR comment reporting.

Changes Made

Removed Instrumented Tests

  • AVD cache step: Removed Android Virtual Device caching logic
  • AVD creation step: Removed emulator setup and snapshot generation
  • Instrumented test execution: Removed connectedBetaDebugAndroidTest step that ran UI tests on Android emulator

Added Lint Step with PR Comments

  • New lint step: Added ./gradlew lintBetaDebug --stacktrace execution
  • Positioned strategically: Runs after unit tests but before APK generation
  • No conditions: Executes on both pull requests and regular builds
  • Automatic PR comments: Lint results are automatically posted as PR comments for easy review
  • Artifact upload: Lint reports (XML and HTML) are uploaded as build artifacts
  • Error handling: Lint step continues on error to ensure reports are posted even when issues are found

Benefits

Performance Improvements:

  • Significantly faster CI builds by eliminating emulator startup time
  • Reduced resource usage without Android Virtual Device provisioning
  • Streamlined workflow execution

Code Quality:

  • Automated lint checking catches potential issues early
  • Maintains code standards and best practices
  • Integrates seamlessly with existing CI pipeline
  • Enhanced visibility: Lint results appear directly as PR comments for immediate reviewer feedback

Maintained Functionality:

  • All existing steps remain intact (unit tests, code coverage, APK generation)
  • No impact on release process or artifact uploads
  • Preserves conditional logic for pull request vs regular build differences

The workflow now focuses on fast feedback through unit tests and lint checks while maintaining robust APK generation for distribution. Lint issues are automatically surfaced as PR comments, making code review more efficient and ensuring code quality standards are maintained.

Original prompt

On android.yml, Disable instrumented tests in github workflow and add a step for running gradlew lint


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Disable instrumented tests in github workflow and add a step for running gradlew lint Disable instrumented tests and add lint step to Android CI workflow Sep 27, 2025
@RitikaPahwa4444
Copy link
Owner

@copilot can you help add the lint report as a PR comment whenever it gets generated?

Copy link
Author

Copilot AI commented Sep 27, 2025

@copilot can you help add the lint report as a PR comment whenever it gets generated?

I've added the lint report as PR comment functionality! The changes include:

  • Modified the lint step to continue on error (so reports are posted even if issues are found)
  • Added lint results upload as artifacts (XML and HTML formats)
  • Added automatic PR comment posting using yutailang0119/action-android-lint@v4
  • All lint reporting steps only run on pull requests to avoid spam

The lint results will now automatically appear as PR comments whenever the workflow runs on pull requests. Commit: 26c5521

Copilot AI changed the title Disable instrumented tests and add lint step to Android CI workflow Disable instrumented tests and add lint step with PR comments to Android CI workflow Sep 27, 2025
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.

2 participants