fix(ci): move setup-java after android project generation - #159
Merged
Merged
Conversation
Bumps the actions group with 2 updates: [actions/setup-java](https://github.com/actions/setup-java) and [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog). Updates `actions/setup-java` from 5 to 6 - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@v5...v6) Updates `trufflesecurity/trufflehog` from 3.97.0 to 3.97.1 - [Release notes](https://github.com/trufflesecurity/trufflehog/releases) - [Commits](trufflesecurity/trufflehog@bcfcf73...20652fb) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: trufflesecurity/trufflehog dependency-version: 3.97.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
actions/setup-java@v5 only warned when cache: gradle found no gradle files to key on; @v6 hard-fails the job instead. build-capacitor.yml, build-react-native.yml, and deploy-mobile-android.yml all ran Setup Java before the step that generates the native android/ project (via cap add/cap sync or RN's install), so no gradle files existed yet at that point. android/ is gitignored, never committed, so this always happened on a fresh checkout. Move Setup Java to run after the android project exists, matching the pattern already used in ci.yml. Also add cache-dependency-path so the gradle cache keys correctly once the files are present. These workflows are workflow_dispatch-only (or tag-triggered for deploy-mobile-android), so PR checks never exercise them and #157's green PR checks did not catch this. Verified by dispatching build-capacitor.yml and build-react-native.yml directly against this branch.
PR Checks Summary
✅ All checks passed! Ready for review. |
Security Scan Results: PASSED
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #157 (bumps
actions/setup-java@v5->@v6). That PR's checksare green but misleading: every job that runs setup-java is skipped on a
normal PR (
build-capacitor.yml/build-react-native.ymlareworkflow_dispatch-only;deploy-mobile-android.ymlis tag-triggered). Theseworkflows have never run on
main.Dispatching them directly against #157's branch, both failed at the Setup
Java step:
Cause:
cache: 'gradle'inactions/setup-javaneeds gradle files to keyits cache on. In v5 a miss was a warning; in v6 it's a hard job failure. The
native
android/project in this repo is gitignored and generated at buildtime (
npx cap add android/ capacitor sync), so on a fresh checkout nogradle files exist until that generation step runs. All three workflows ran
Setup Java before that step.
Changes
build-capacitor.yml: moveSetup Javato afterAdd + Sync Capacitor Androidbuild-react-native.yml: moveSetup Javato afterInstall dependencies(which generates the native project)deploy-mobile-android.yml: moveSetup Javato afterSync Capacitorcache-dependency-pathso the gradle cache keys correctly once the files existci.ymlalready had this exact fix (with an explanatory comment) from anearlier change — these three workflows follow the same pattern.
actions/setup-java@v6is kept, not reverted.Verification
Dispatched both
build-capacitor.ymlandbuild-react-native.ymldirectlyagainst this branch:
build-react-native.yml(run 33085534559): fails atInstall dependencies("No such file or directory") — pre-existing, unrelated:
frontend/platforms/react-nativedoes not exist in this repo (not inpnpm-workspace.yaml, no tracked files). The React Native platform wasnever scaffolded. Setup Java never reaches execution because of this
earlier failure; this is unrelated to the setup-java ordering fix and out
of scope here.
build-capacitor.yml(run 33085531501): fails earlier, atBuild web assets(HASURA_ADMIN_SECRET must be set for production builds- theworkflow's
pnpm buildstep never passes that secret through, anotherpre-existing gap unrelated to setup-java).
To isolate and prove the actual fix, I ran a disposable local-only
verification (never pushed as part of this PR) that patched around those two
unrelated pre-existing gaps (passed
HASURA_ADMIN_SECRETthrough, added themissing mobile
vite buildstep thatci.ymlalready has). With thoseworkarounds, the real fix in this PR was exercised end-to-end:
Full job: https://github.com/nself-org/nchat/actions/runs/33086902029
Test plan
build-capacitor.ymlandbuild-react-native.ymlagainst this branchbuild-react-native.ymlneeds its own fix to scaffoldfrontend/platforms/react-nativebefore it can be exercised for real (separate, pre-existing issue, not addressed here)build-capacitor.yml's production workflow needsHASURA_ADMIN_SECRETwired into theBuild web assetsstep (separate, pre-existing issue, not addressed here)