Skip to content

DEV-1115 Add CI build of the library and every example - #124

Merged
MAzalya merged 5 commits into
masterfrom
DEV-1115_ci_build
Oct 19, 2026
Merged

MAzalya merged 5 commits into
masterfrom
DEV-1115_ci_build

Conversation

@JongChern

@JongChern JongChern commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds .github/workflows/ci.yml, the repo's first CI. It runs on every PR into master and every push to master.

It runs ./gradlew assembleDebug --continue -Pandroid.useAndroidX=true from ShimmerAndroidInstrumentDriver/. Because the task is selected by name from the Gradle root, this builds the library and all twelve modules in settings.gradle, and a module added later is picked up without editing the workflow. --continue lists every broken module in one run; the run still fails if any did.

This means a shimmerdriver/shimmerbluetoothmanager pin bump is proven against the examples before it merges (DEV-1115).

Setup:

  • JDK 17 Temurin, as in the release workflow (DEV-1115_release_workflow).
  • Every action pinned to a full commit SHA.
  • -Pandroid.useAndroidX=true on the command line, because gradle.properties is gitignored.
  • A 4 GB Gradle daemon heap and a 30-minute job timeout (DEV-1115 Give the CI Gradle daemon 4 GB and a 30-minute timeout #125). At the default 512 MB, D8 runs out of heap while dexing the examples and the daemon hangs instead of failing.

Driver authentication

The driver is resolved from Shimmer-Java-Android-API's GitHub Packages with this repo's GITHUB_TOKEN only (packages: read). No long-lived token is used, because PR builds run the PR's own Gradle scripts, which could read one. If resolution is ever refused (401/403 on com.shimmerresearch:shimmerdriver), grant this repo read access in that package's "Manage Actions access" settings rather than adding a token.

Also: gradlew marked executable

ShimmerAndroidInstrumentDriver/gradlew was committed as 100644, so ./gradlew fails with "Permission denied" on a Linux runner. This PR sets it to 100755. The release workflow needs the same change, so merge this first or apply it there too.

Verified

  • This PR's own CI run passes: all 12 modules build in about 5 minutes with GITHUB_TOKEN alone.
  • Locally (JDK 21, Gradle 8.5, AGP 8.2.2), assembleDebug --dry-run selects exactly the 12 :<module>:assembleDebug tasks in settings.gradle.
  • With one example's preBuild made to throw, ./gradlew preBuild --continue exited 1 and the other 11 modules still ran.

Notes

  • master has no required status checks yet. Once this merges, a repo admin can make "Build library and examples" required.
  • shimmerBasicExample builds against the published shimmerandroidinstrumentdriver:3.2.8_beta aar, not the in-tree library. It still proves the driver pin, which every module gets from the root build.gradle.

🤖 Generated with Claude Code

JongChern and others added 2 commits October 15, 2026 12:13
Builds on every PR into master and every push to master: assembleDebug run
by name from the Gradle root, so the library and all twelve modules in
settings.gradle are built, and a module added later is picked up without
editing the workflow. --continue lists every broken module in one run; the
run still fails if any did. A driver pin bump is now proven against the
examples before it merges.

Same setup as the release workflow: JDK 17 temurin, setup-gradle pinned,
-Pandroid.useAndroidX=true because gradle.properties is gitignored, and the
driver resolved from Shimmer-Java-Android-API's GitHub Packages with
GITHUB_TOKEN or the PACKAGES_READ_TOKEN secret.

Also marks gradlew executable: it was committed as 100644, so ./gradlew
fails with "Permission denied" on a Linux runner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first CI run ran out of heap (Gradle's default 512 MB) while D8
dexed the examples, and the daemon then hung until GitHub cancelled the
job at 6 hours. gradle.properties is gitignored, so pass
org.gradle.jvmargs on the command line, and cap the job at 30 minutes.

Reproduced locally (JDK 17, Gradle 8.5): at -Xmx512m the build fails
with "D8: java.lang.OutOfMemoryError: Java heap space"; at -Xmx4g it
passes in 4m47s with assembleDebug run in all 12 modules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
DEV-1115 Give the CI Gradle daemon 4 GB and a 30-minute timeout
Copilot AI lite review requested due to automatic review settings October 18, 2026 05:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The workflow risks exposing a long-lived package token and may use an incorrect PAT username.

2 open issues
What changed in this PR

Adds GitHub Actions CI to build the Android library and examples, and marks the Gradle wrapper executable.

Changes:

  • Adds PR and master push CI.
  • Configures Java 17, Gradle, AndroidX, and package authentication.
  • Enables building all modules with assembleDebug --continue.
  • Marks gradlew executable.

Review findings:

  • Critical: PACKAGES_READ_TOKEN may be exposed to untrusted pull-request code.
  • Moderate: PAT authentication may fail because the username remains github.actor.
File Summary
ShimmerAndroidInstrumentDriver/​gradlew Provides the executable Gradle wrapper script.
.github/​workflows/​ci.yml Defines Android CI and package authentication.

Review effort: Lite

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Drops the PACKAGES_READ_TOKEN fallback. PR builds run the PR's own Gradle
scripts, so a long-lived token in their environment could be read by them,
and a PAT would also need its owner's username rather than github.actor.
Neither secret exists and the PR build passes with GITHUB_TOKEN alone. If
that is ever refused, the fix is to grant this repo read access on the
package, not to add a token.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 18, 2026 05:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Pin all workflow actions to full commit SHAs and commit gradlew with executable permissions; align the authentication documentation with the workflow.

1 open issue
2 resolved since last review

Review effort: Lite

Comment thread .github/workflows/ci.yml Resolved
The job holds a packages: read GITHUB_TOKEN, so a moved tag should not be
able to change what runs with it. Same form as setup-gradle; both SHAs are
the commits v4 points at today, so the build itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 18, 2026 05:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@JongChern
JongChern requested a review from MAzalya October 18, 2026 06:19
@JongChern

Copy link
Copy Markdown
Contributor Author

@MAzalya thanks for #125, it's merged, and the build now passes on GitHub with the 4 GB heap. Since then, ci.yml resolves the driver with GITHUB_TOKEN only, and checkout and setup-java are pinned to commit SHAs. Could you take another look?

JongChern added a commit that referenced this pull request Oct 18, 2026
Three follow-ups ahead of review:
- The release build job now also builds every example app against the
  driver this release ships with, before anything is published. ci.yml
  only ever builds them against master's default driver, so a release
  that picks a newer driver was never built with the examples (raised
  in #126). Both build steps pass the 4 GB daemon heap from #125.
- The publishing block accepts gpr.usr as well as gpr.user, since the
  root build.gradle reads gpr.usr (also raised in #126).
- actions/* steps are pinned to commit SHAs, matching #124: each is the
  commit its v4 tag points at today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@MAzalya MAzalya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. CI is green, the pinned SHAs match their tags, and the build now uses GITHUB_TOKEN only.

Non-blocking nit: actions/checkout here doesn't set persist-credentials: false as #123 and the Java release workflow do. The token is read-only, so the risk is low, but it would be consistent.

@MAzalya
MAzalya merged commit 0cf4df1 into master Oct 19, 2026
2 checks passed
@MAzalya
MAzalya deleted the DEV-1115_ci_build branch October 19, 2026 07:27
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