-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a github workflow that checks common (and less common) gradle tasks when gradle version is changed #13456
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6f87e60
Run misc gradle tasks on gradle upgrade to make sure everything works.
dweiss f9b7b57
Correct syntax.
dweiss 9b8c141
Run workflow on the branch.
dweiss decd47b
Add more targets.
dweiss ceffcde
Try to install libjson-perl for regenerate.
dweiss 74cccc8
Try to install libjson-perl for regenerate.
dweiss e15b936
Try to install libwww-perl for regenerate.
dweiss f56a4e3
Reset after regenerate.
dweiss a98e077
Reset and clean after regenerate.
dweiss a7c75a9
Add reporting of regenerate status.
dweiss 5bbc5ae
Remove self-branch.
dweiss 0d04d76
Trying out a matrix-combination workflow so that it runs with RUNTIME…
dweiss 83fc3aa
Correct indent.
dweiss 882915d
Add self branch so that I can experiment locally.
dweiss dd9175f
Merge remote-tracking branch 'origin/main' into run-misc-gradle-tasks…
dweiss c08459a
Merge remote-tracking branch 'origin/main' into run-misc-gradle-tasks…
dweiss 75f1c75
Force action re-run.
dweiss 666f36b
Copy the default jdk to /tmp to force gradle to pick it up as an alte…
dweiss 3feea19
Correct rsync options.
dweiss e17a139
Rsync the contents of the jdk folder.
dweiss ea14739
Add all tasks back and do a final run.
dweiss eab3ab8
Change job description.
dweiss 640b564
Remove local branch.
dweiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: "Run checks: gradle upgrade" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
branches: | ||
- 'main' | ||
- 'branch_9x' | ||
paths: | ||
- '.github/workflows/run-checks-gradle-upgrade.yml' | ||
- 'gradle/wrapper/**' | ||
|
||
push: | ||
branches: | ||
- 'main' | ||
- 'branch_9x' | ||
paths: | ||
- '.github/workflows/run-checks-gradle-upgrade.yml' | ||
- 'gradle/wrapper/**' | ||
|
||
env: | ||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} | ||
|
||
jobs: | ||
gradleSanityCheck: | ||
name: "Run tasks (java: ${{ matrix.java-version }}, alt-java: ${{ matrix.uses-alt-java }})" | ||
timeout-minutes: 30 | ||
|
||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
java-version: [ '22' ] | ||
uses-alt-java: [ true, false ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
ALT_JAVA_DIR: /tmp/alt-java | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/prepare-for-build | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
|
||
- name: Set up RUNTIME_JAVA_HOME variable | ||
if: ${{ matrix.uses-alt-java }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're running with the "uses-alt-java" switch, we set up an "alternative" java distribution under /tmp and use it to execute the same set of gradle tasks. |
||
run: | | ||
echo "All installed JDKs:" | ||
set | grep "JAVA" | ||
|
||
echo "Gradle's 'RUNTIME_JAVA_HOME' JDK:" | ||
RUNTIME_JAVA_HOME_VAR=JAVA_HOME_`echo ${{ matrix.java-version }} | egrep --only "[0-9]+"`_X64 | ||
echo ${RUNTIME_JAVA_HOME_VAR} points at ${!RUNTIME_JAVA_HOME_VAR} | ||
|
||
# Copy the JDK from its default location to /tmp so that it appears different to gradle. | ||
rsync -av ${!RUNTIME_JAVA_HOME_VAR}/ ${{ env.ALT_JAVA_DIR }}/ | ||
|
||
# This sets the environment variable and makes it available for subsequent job steps. | ||
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable | ||
echo "RUNTIME_JAVA_HOME=${{ env.ALT_JAVA_DIR }}" >> "$GITHUB_ENV" | ||
|
||
- run: ./gradlew -p lucene/core check -x test | ||
|
||
- name: ./gradlew regenerate | ||
run: | | ||
# add this package for generateEmojiTokenizationTestChecksumLoad. | ||
sudo apt-get install libwww-perl | ||
./gradlew regenerate -x generateUAX29URLEmailTokenizerInternal --rerun-tasks | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
echo ":warning: **regenerateleft local checkout in modified state**" >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
git status --porcelain >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
git reset --hard && git clean -xfd . | ||
fi | ||
|
||
- run: ./gradlew testOpts | ||
- run: ./gradlew helpWorkflow | ||
- run: ./gradlew licenses updateLicenses | ||
- run: ./gradlew tidy | ||
- run: ./gradlew check -x test | ||
- run: ./gradlew assembleRelease mavenToLocal | ||
|
||
# Conserve resources: only run these in non-alt-java mode. | ||
- run: ./gradlew getGeoNames | ||
if: ${{ !matrix.uses-alt-java }} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the configuration matrix switch that is used to control whether the build runs with a separate RUNTIME_JAVA_HOME or without it.