fix(ci): upgrade setup-java to v4 with temurin distribution#209
fix(ci): upgrade setup-java to v4 with temurin distribution#209islameldesoky95 merged 1 commit intomasterfrom
Conversation
actions/setup-java@v1 sets JAVA_HOME to a path that no longer exists on macOS-14 runners (/Users/runner/hostedtoolcache/jdk/...), causing Gradle to fail with "JAVA_HOME is set to an invalid directory". Upgrading to v4 + temurin fixes the JAVA_HOME resolution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
📝 WalkthroughWalkthroughUpdates the Android CI workflow's Java setup action from version 1 to version 4. Adjusts the Java version specification from unquoted to quoted format and explicitly adds the Temurin distribution parameter. Total changes: 3 additions, 2 deletions. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
PR Summary: Summary: Upgrade GitHub Actions setup-java in the test-android workflow from v1 to v4 and explicitly select Temurin JDK 17. Changes:
Notes / impact:
|
|
CodeAnt AI finished reviewing your PR. |
|
Reviewed up to commit:3744543933284cfb4f710660167e5609f109fc67 Additional Suggestion.github/workflows/ci.yml, line:147Using @v4 is fine, but for stricter reproducibility consider pinning to a specific minor/patch tag (e.g. actions/setup-java@v4.8.0) or a commit SHA if you want to avoid unexpected behavior from future v4.x releases. (Refer to the change at line ~147.) - name: Java 17
uses: actions/setup-java@v4.5.0
with:
java-version: '17'
distribution: 'temurin' |
|
CodeAnt AI is running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis PR updates the CI workflow to use actions setup-java v4 with the Temurin distribution so that Java 17 is installed correctly and Gradle runs with a valid JAVA_HOME on macOS runners. sequenceDiagram
participant Developer
participant CI
participant SetupJava
participant TemurinJDK
participant Gradle
Developer->>CI: Open pull request
CI->>SetupJava: Setup Java 17 with Temurin
SetupJava->>TemurinJDK: Download and install Java 17
TemurinJDK-->>SetupJava: Provide Java 17 installation path
SetupJava-->>CI: Export valid JAVA_HOME
CI->>Gradle: Run build using JAVA_HOME
Generated by CodeAnt AI |
|
CodeAnt AI finished running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
User description
actions/setup-java@v1 sets JAVA_HOME to a path that no longer exists on macOS-14 runners (/Users/runner/hostedtoolcache/jdk/...), causing Gradle to fail with "JAVA_HOME is set to an invalid directory".
Upgrading to v4 + temurin fixes the JAVA_HOME resolution.
Summary by CodeRabbit
CodeAnt-AI Description
Fix Java setup in CI on macOS runners
What Changed
Impact
✅ Fewer CI failures on macOS✅ Reliable Gradle checks in pull requests✅ Fewer Java environment errors🔄 Retrigger CodeAnt AI Review
Details
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.