Skip to content
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 23 commits into from
Jun 6, 2024

Conversation

dweiss
Copy link
Contributor

@dweiss dweiss commented Jun 5, 2024

This is mostly an automated sanity check that common (and less common) tasks work after an upgrade. This is what the output looks like:

https://github.com/dweiss/lucene/actions/runs/9389691271

@dweiss
Copy link
Contributor Author

dweiss commented Jun 5, 2024

This is a follow up to #13453 - perhaps it'll make life a bit easier.

@ChrisHegarty
Copy link
Contributor

I think that this is good. Would it run on all CI jobs, or you somehow opt-in?

Running with RUNTIME_JAVA_HOME does have a slightly different code path in the gradle build files. Not sure if that could be easily covered.

I just merged the gradle wrapper update to main and branch_9x, so maybe sync up this PR branch to ensure that all is still good. :-)

@dweiss
Copy link
Contributor Author

dweiss commented Jun 6, 2024

I think that this is good. Would it run on all CI jobs, or you somehow opt-in?

There is a filtering restriction - it'll run on PRs and pushes to these two branches and when the commit matches path specs. I think this restricts it reasonably well.

    branches:
      - 'main'
      - 'branch_9x'
    paths:
      - '.github/workflows/run-checks-gradle-upgrade.yml'
      - 'gradle/wrapper/**'

Running with RUNTIME_JAVA_HOME does have a slightly different code path in the gradle build files. Not sure if that could be easily covered.

Yes, I think so. The run-nightly-smoketester.yml workflow uses this explicit variable to test against 22-ea.

There are probably more tasks/ paths to cover. This is just a PoC and a start.

@dweiss dweiss self-assigned this Jun 6, 2024
@dweiss dweiss added this to the 10.0.0 milestone Jun 6, 2024
@dweiss
Copy link
Contributor Author

dweiss commented Jun 6, 2024

Let me close this PR so that it doesn't rerun all the checks while I'm trying to figure it out locally.

@dweiss dweiss closed this Jun 6, 2024
@dweiss dweiss reopened this Jun 6, 2024
matrix:
os: [ ubuntu-latest ]
java-version: [ '22' ]
uses-alt-java: [ true, false ]
Copy link
Contributor Author

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.

java-version: ${{ matrix.java-version }}

- name: Set up RUNTIME_JAVA_HOME variable
if: ${{ matrix.uses-alt-java }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@dweiss
Copy link
Contributor Author

dweiss commented Jun 6, 2024

I've added a matrix configuration so that one job runs with RUNTIME_JAVA_HOME and the other without it. Seems to be working and increases test coverage.

image

@dweiss
Copy link
Contributor Author

dweiss commented Jun 6, 2024

I think this is ready and works reasonably well - it caught #13458 already.

Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

Thanks for this @dweiss LGTM (and thanks for catching and fixing the issue I caused by updating the wrapper)

@dweiss dweiss merged commit 14782a2 into apache:main Jun 6, 2024
10 checks passed
@dweiss dweiss deleted the run-misc-gradle-tasks-on-upgrade branch June 6, 2024 13:36
asfgit pushed a commit that referenced this pull request Jun 6, 2024
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