Skip to content

fix(ci): upgrade setup-java to v4 with temurin distribution#209

Merged
islameldesoky95 merged 1 commit intomasterfrom
fix/ci-android-java-home
Apr 27, 2026
Merged

fix(ci): upgrade setup-java to v4 with temurin distribution#209
islameldesoky95 merged 1 commit intomasterfrom
fix/ci-android-java-home

Conversation

@islameldesoky95
Copy link
Copy Markdown
Collaborator

@islameldesoky95 islameldesoky95 commented Apr 27, 2026

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

  • Chores
    • Updated continuous integration workflow configuration to enhance build process reliability.

CodeAnt-AI Description

Fix Java setup in CI on macOS runners

What Changed

  • The CI workflow now sets up Java 17 in a way that works on current macOS runners.
  • Gradle checks no longer rely on an outdated Java setup that could point to an invalid Java home path.
  • The CI job now uses the Temurin Java distribution for the build step.

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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
Copy link
Copy Markdown

codeant-ai Bot commented Apr 27, 2026

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 ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

📝 Walkthrough

Walkthrough

Updates 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

Cohort / File(s) Summary
Java CI Workflow Update
.github/workflows/ci.yml
Updates actions/setup-java from v1 to v4, changes Java version from unquoted 17 to quoted '17', and explicitly specifies distribution: temurin.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A workflow update, so clean and bright,
Java actions now set just right,
Version four takes the stage with flair,
Temurin specified with utmost care! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(ci): upgrade setup-java to v4 with temurin distribution' directly and clearly summarizes the main change: upgrading the GitHub Actions setup-java action to v4 and specifying the temurin distribution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-android-java-home

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pantoaibot
Copy link
Copy Markdown

pantoaibot Bot commented Apr 27, 2026

PR Summary:

Summary: Upgrade GitHub Actions setup-java in the test-android workflow from v1 to v4 and explicitly select Temurin JDK 17.

Changes:

  • Modified .github/workflows/ci.yml (test-android job).
  • actions/setup-java@v1 -> actions/setup-java@v4.
  • java-version changed to '17' (string) and added distribution: 'temurin'.
  • All other CI steps unchanged (checkout, setup-node, build, tests, coverage upload).

Notes / impact:

  • CI will now use Temurin JDK 17 on the macOS runner; functional build/test steps remain the same.
  • No code changes in project source; verify Android Gradle tasks in CI once to catch any vendor-specific JDK differences.

Reviewed by Panto AI

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Apr 27, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented Apr 27, 2026

CodeAnt AI finished reviewing your PR.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
@pantoaibot
Copy link
Copy Markdown

pantoaibot Bot commented Apr 27, 2026

Reviewed up to commit:3744543933284cfb4f710660167e5609f109fc67

Additional Suggestion
.github/workflows/ci.yml, line:147 Using @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'

Reviewed by Panto AI

Copy link
Copy Markdown
Collaborator

@uc-brunosilva uc-brunosilva left a comment

Choose a reason for hiding this comment

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

lgtm

@islameldesoky95 islameldesoky95 merged commit 5c55d83 into master Apr 27, 2026
12 checks passed
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 2, 2026

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 ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:XS This PR changes 0-9 lines, ignoring generated files and removed size:XS This PR changes 0-9 lines, ignoring generated files labels May 2, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 2, 2026

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 2, 2026

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 ·
Reddit ·
LinkedIn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants