Switch to Using Gradle Wrapper Exclusively #3803
Merged
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.
What was the problem?
The workflow used
gradle/actions/setup-gradle@v3
to manage the Gradle version, which was redundant since the project already uses the Gradle Wrapper (./gradlew
). This redundancy created the potential for version conflicts ifsetup-gradle
and the Gradle Wrapper specified different versions.Additionally, setting the Ubuntu version in the workflow worked temporarily but failed after Ubuntu 20.04.6 upgraded to Gradle 8.11 (GitHub Actions update) 😅. It's also impossible to pin to the correct minor version in GH workflows (20.04.05).
How does this fix it?
gradle/actions/setup-gradle@v3
to ensure the Gradle Wrapper exclusively manages the Gradle version.gradle-wrapper.properties
(8.10.2) is always used, ensuring consistency and avoiding version mismatches.cache-read-only
,gradle-home-cache-cleanup
).rm -rf ~/.gradle || true
) to prevent residual or mismatched Gradle versions from interfering with the build process.This approach aligns the workflow with best practices by relying on the Gradle Wrapper for version management and ensures the workflow remains functional despite changes to the Ubuntu image.
How to test this PR
gradle-wrapper.properties
) is used during all builds.Note: running
abd-vro-internal
, this change seems to work!https://github.com/department-of-veterans-affairs/abd-vro-internal/actions/runs/12022537477/job/33514927530#step:13:2