Skip to content

Add GitHub Actions CI for pull requests#4

Merged
benju69 merged 3 commits into
mainfrom
copilot/add-simple-ci-github-actions
Apr 12, 2026
Merged

Add GitHub Actions CI for pull requests#4
benju69 merged 3 commits into
mainfrom
copilot/add-simple-ci-github-actions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Adds a CI pipeline that runs on every pull request to validate tests, build the app, and expose the APK for device testing.

Workflow (ci.yml)

  • Permissions: Least-privilege — contents: read and pull-requests: write
  • Test: ./gradlew test across all modules (JUnit Jupiter)
  • Build: ./gradlew assembleDebug — debug variant avoids the uncommitted keystore requirement
  • Caching: Gradle dependency cache enabled via actions/setup-java (cache: gradle) to speed up runs and reduce flakiness from transient download failures
  • Artifact: uploads app/build/outputs/apk/debug/app-debug.apk via actions/upload-artifact@v4 with if-no-files-found: error and 7-day retention; fails loudly if the APK is missing
  • PR Comment: posts a comment on the PR with the direct artifact download URL after each successful build using actions/github-script@v7

@benju69 benju69 marked this pull request as ready for review April 12, 2026 07:08
Copilot AI review requested due to automatic review settings April 12, 2026 07:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to run CI on pull requests, validating unit tests and producing a debug APK artifact for manual/device testing.

Changes:

  • Introduces a PR-triggered CI workflow.
  • Runs ./gradlew test and ./gradlew assembleDebug on ubuntu-latest.
  • Uploads the generated debug APK as a downloadable Actions artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
pull_request:

jobs:
build:
Comment thread .github/workflows/ci.yml
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fix this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9d26a50. Added cache: gradle to actions/setup-java to cache the Gradle dependency graph between runs. Also took the opportunity to add permissions: contents: read (least-privilege) and if-no-files-found: error + retention-days: 7 on the APK upload step.

Comment thread .github/workflows/ci.yml
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
@benju69
Copy link
Copy Markdown
Owner

benju69 commented Apr 12, 2026

@copilot add the artifact download url in comment in the pr

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot add the artifact download url in comment in the pr

Done in bef8e0d. After the APK is uploaded, actions/github-script@v7 posts a comment on the PR with a direct download link using the artifact-url output from the upload step. Added pull-requests: write to the workflow permissions to allow posting comments.

@github-actions
Copy link
Copy Markdown

ghost commented Apr 12, 2026

📦 Debug APK ready

Download app-debug.apk

@benju69 benju69 merged commit 078a539 into main Apr 12, 2026
1 check passed
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.

3 participants