From d0c5068e9420ee39ee213416c53504e005990587 Mon Sep 17 00:00:00 2001 From: JongChern Date: Thu, 15 Oct 2026 12:13:57 +0800 Subject: [PATCH 1/4] DEV-1115 Add CI build of the library and every example 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 --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++ ShimmerAndroidInstrumentDriver/gradlew | 0 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/ci.yml mode change 100644 => 100755 ShimmerAndroidInstrumentDriver/gradlew diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e4b8ee77 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +# Build check for every PR into master and every push to master: the library and every example +# module in settings.gradle. A driver pin bump is proven against the examples before it merges +# (DEV-1115). Releases are a separate, dispatch-only workflow (release.yml). +# +# assembleDebug is run by name from the Gradle root, so Gradle runs it in every module that has +# it: a module added to settings.gradle is built here without editing this file. --continue keeps +# building after a failure so one run lists every broken module; the run still fails if any did. +# +# Reading the driver from Shimmer-Java-Android-API's GitHub Packages uses this repo's GITHUB_TOKEN. +# If that is refused (401/403 resolving com.shimmerresearch:shimmerdriver), add a classic token +# with read:packages as the PACKAGES_READ_TOKEN secret and it is used instead. + +name: CI + +on: + pull_request: + branches: [master] + push: + branches: [master] + +concurrency: + group: ci-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +defaults: + run: + working-directory: ShimmerAndroidInstrumentDriver + +jobs: + build: + name: Build library and examples + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + env: + # Read by the repositories in the root build.gradle to resolve the driver. + USERNAME: ${{ github.actor }} + TOKEN: ${{ secrets.PACKAGES_READ_TOKEN || github.token }} + steps: + - uses: actions/checkout@v4 + + # AGP 8 needs JDK 17. + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 + + # gradle.properties is gitignored here, so android.useAndroidX (needed for the androidx + # dependencies) is passed on the command line. + - name: Build the library and every example + run: ./gradlew assembleDebug --continue -Pandroid.useAndroidX=true diff --git a/ShimmerAndroidInstrumentDriver/gradlew b/ShimmerAndroidInstrumentDriver/gradlew old mode 100644 new mode 100755 From 14afe6639dbd5cb1fa2b4ce5a1935a185583e694 Mon Sep 17 00:00:00 2001 From: Mas Azalya Date: Fri, 16 Oct 2026 12:23:02 +0800 Subject: [PATCH 2/4] DEV-1115 Give the CI Gradle daemon 4 GB and a 30-minute timeout 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 --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4b8ee77..f551bc0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: build: name: Build library and examples runs-on: ubuntu-latest + timeout-minutes: 30 # a hung Gradle daemon otherwise holds the runner for 6 hours permissions: contents: read packages: read @@ -51,6 +52,9 @@ jobs: uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 # gradle.properties is gitignored here, so android.useAndroidX (needed for the androidx - # dependencies) is passed on the command line. + # dependencies) and the daemon heap are passed on the command line. Gradle's default 512 MB + # heap runs out while dexing the examples, and the daemon then hangs instead of failing. - name: Build the library and every example - run: ./gradlew assembleDebug --continue -Pandroid.useAndroidX=true + run: >- + ./gradlew assembleDebug --continue -Pandroid.useAndroidX=true + -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=1g" From b0ab7fa71abe73f0664616d17b8736fb3df6b511 Mon Sep 17 00:00:00 2001 From: JongChern Date: Sun, 18 Oct 2026 13:25:57 +0800 Subject: [PATCH 3/4] DEV-1115 CI: resolve the driver with GITHUB_TOKEN only 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 --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f551bc0d..e8a07b64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,10 @@ # it: a module added to settings.gradle is built here without editing this file. --continue keeps # building after a failure so one run lists every broken module; the run still fails if any did. # -# Reading the driver from Shimmer-Java-Android-API's GitHub Packages uses this repo's GITHUB_TOKEN. -# If that is refused (401/403 resolving com.shimmerresearch:shimmerdriver), add a classic token -# with read:packages as the PACKAGES_READ_TOKEN secret and it is used instead. +# Reading the driver from Shimmer-Java-Android-API's GitHub Packages uses this repo's GITHUB_TOKEN +# only, never a long-lived token: PR builds run the PR's own build scripts, which could read it. +# If that is refused (401/403 resolving com.shimmerresearch:shimmerdriver), give this repo read +# access in the package's "Manage Actions access" settings rather than adding a token here. name: CI @@ -37,7 +38,7 @@ jobs: env: # Read by the repositories in the root build.gradle to resolve the driver. USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.PACKAGES_READ_TOKEN || github.token }} + TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 From 4bdada99d21212b66a7b79d8dd7145cfd254741c Mon Sep 17 00:00:00 2001 From: JongChern Date: Sun, 18 Oct 2026 13:30:18 +0800 Subject: [PATCH 4/4] DEV-1115 CI: pin checkout and setup-java to commit SHAs 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 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8a07b64..05ecf622 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,11 +40,11 @@ jobs: USERNAME: ${{ github.actor }} TOKEN: ${{ github.token }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 # AGP 8 needs JDK 17. - name: Set up JDK 17 - uses: actions/setup-java@v4 + uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1 with: java-version: '17' distribution: 'temurin'