Skip to content

Add build-changed task in Java workflow#3125

Closed
jagdish-15 wants to merge 1 commit intoexercism:mainfrom
jagdish-15:add-build-changed
Closed

Add build-changed task in Java workflow#3125
jagdish-15 wants to merge 1 commit intoexercism:mainfrom
jagdish-15:add-build-changed

Conversation

@jagdish-15
Copy link
Copy Markdown
Member

pull request


Reviewer Resources:

Track Policies

@jagdish-15 jagdish-15 requested a review from kahgoh May 8, 2026 22:21
@jagdish-15 jagdish-15 changed the title ci: implement build-changed strategy for targeted test compilation Add build-changed task in Java workflow May 9, 2026
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
with:
java-version: 21
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should use Java 25 (the test runner uses Java 25).

changed_files=$(git diff --name-only "$MERGE_BASE" HEAD)

# If any Gradle build file changed, run the full suite and exit
if echo "$changed_files" | grep -qE '\.(gradle|gradlew|bat)$|settings\.gradle'; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we also need to also check the Gradle wrapper files (gradle-wrapper.jar and gradle-wrapper.properties)

Copy link
Copy Markdown
Member Author

@jagdish-15 jagdish-15 May 9, 2026

Choose a reason for hiding this comment

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

In that case, should we also add the following in the yml file:

  pull_request:
    paths:
      - "**/*.java"
      - "**/*.gradle"
      - "**/gradle-wrapper.properties"
      - "**/gradle-wrapper.jar"
      - "**/gradlew"
      - "**/gradlew.bat"

Currently it's:

  pull_request:
    paths:
      - "**/*.java"
      - "**/*.gradle"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Initially, I just added this line since that is what we did for the test-changed task

@jagdish-15
Copy link
Copy Markdown
Member Author

Superseded by #3126

@jagdish-15 jagdish-15 closed this May 9, 2026
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.

2 participants