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

Continuous integration improvements #2789

Open
wants to merge 49 commits into
base: master
Choose a base branch
from

Conversation

jord1e
Copy link
Contributor

@jord1e jord1e commented Apr 9, 2022

Fixes #2676

Does the following:

  1. Updates GitHub Actions dependencies
  2. Run tests on HotSpot, OpenJ9 VM,
  3. Run tests on Ubuntu and Windows
  4. Run tests on Java 8 (latest), 8.0.282 (earliest supported), 11 (LTS), 17 (LTS) and 18 (latest)
  5. Compile with Java 8 and test on Java 17 (HotSpot Ubuntu)
  6. Remove Java 8 requirement for sourceCompatibility and targetCompatibility (now resides in gradle.properties and just takes whatever J8 you have installed, or installs the latest J8)

Does not touch deployment of the jars on master, I found it kind of unnecessary because everything is done in PRs anyway and it complicates the build scripts.

This needs to be squashed before merging.

Fixed:
- Generic warnings introduced in Java 9 when using `Stream#of` is used in combination with `Function.identity()`, probably caused by JEP 215 "Tiered Attribution for javac"
- Java 13 introduced `String#stripIndent`, which conflicted with Groovy itself, see apache/groovy#1139, the errors were probably caused by whitespace indentation which was handled differently
- Resolved compiler warning about missing `@Deprecated` on deprecated `ExecutionStepInfo#getFieldContainer` method (JDK 9/JEP 277 "Enhanced Deprecation")
- The wrong `BigInteger` constructor was being used in `ScalarIntTest.groovy` and `ScalarFloatTest.groovy`

Not yet fixed:
- Java 16 modified LineNumberReader#getLineNumber behavior (see JDK-8241020) which messed up MultiSourceReader

Links:
- apache/groovy#1139
- https://bugs.openjdk.java.net/browse/JDK-8241020
- https://github.com/openjdk/jdk/commits/master/src/java.base/share/classes/java/io/LineNumberReader.java
@@ -723,39 +723,39 @@ type Object1 {

then:
newSchema == """\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

stripIndent behaves differently on Java 16+ because it overshadows the Groovy method that was present on String before that.
By just dedenting the tests it works

Also the case for the other two tests

Comment on lines 94 to 101
- name: Archive Gradle Test Summary
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: gradle-test-summary-b${{ matrix.java.c }}-t${{ matrix.java.t || matrix.java.c }}-${{ matrix.dist.name }}-${{ matrix.os }}
path: build/reports/tests/test/
retention-days: 4
if-no-files-found: ignore
Copy link
Contributor Author

@jord1e jord1e Apr 9, 2022

Choose a reason for hiding this comment

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

Example of this can be found at https://github.com/jord1e/graphql-java/actions/runs/2140596163

Go the the Artificats section, Open the .zip, then open index.html in your browser

build.gradle Outdated Show resolved Hide resolved
@dondonz
Copy link
Member

dondonz commented May 17, 2022

Hey @jord1e is there anything else you want to add before review?

@jord1e
Copy link
Contributor Author

jord1e commented May 17, 2022

Hey @jord1e is there anything else you want to add before review?

No. Go ahead :)

@jord1e jord1e mentioned this pull request Jul 27, 2022
# Conflicts:
#	.github/workflows/pull_request.yml
#	build.gradle
@jord1e
Copy link
Contributor Author

jord1e commented Jul 29, 2022

@dondonz I updated the branch

@jord1e
Copy link
Contributor Author

jord1e commented Oct 22, 2023

@dondonz In regards to your comment on #3031 , would you appreciate me actualizing this PR?

Just trying to figure out if it's worth investing time

- { c: '8.0.282', t: '8.0.282' } # Earliest supported Java 8
- { c: '11', t: '11' }
- { c: '17', t: '17' }
- { c: '18', t: '18' }
Copy link
Contributor

@yeikel yeikel Oct 27, 2023

Choose a reason for hiding this comment

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

Given that 18 EOL was reached 1 year ago, we should be able to drop this and replace it with 17, 21, and possibly 22

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now running 11,17,21

I think adding 22-ea in a new PR makes the most sense

Temurin is already releasing EA builds, we just need to make sure Semeru is excluded from the test matrix (or have includes: on 22-ea)

# Conflicts:
#	.github/workflows/master.yml
#	.github/workflows/pull_request.yml
#	.github/workflows/release.yml
#	settings.gradle
Comment on lines +23 to +34
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
- name: Test
uses: gradle/gradle-build-action@v2
with:
arguments: check --info
- name: Publish
uses: gradle/gradle-build-action@v2
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Facilitates better caching

Comment on lines +26 to +37
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
- name: Test
uses: gradle/gradle-build-action@v2
with:
arguments: check --info
- name: Publish
uses: gradle/gradle-build-action@v2
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Facilitates better caching

Comment on lines +16 to +19
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
}

Copy link
Contributor Author

@jord1e jord1e Oct 27, 2023

Choose a reason for hiding this comment

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

Has to be defined in the settings.gradle

Makes sure the relevant JDK is automatically downloaded again. This was changed in a more recent version (of Gradle), it used to download the JDK automatically if it was missing--now we need this plugin

@jord1e
Copy link
Contributor Author

jord1e commented Oct 27, 2023

Tests >= 17 broken because of #3369

@dondonz dondonz added the keep-open Tells Stale Bot to keep PRs and issues open label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-open Tells Stale Bot to keep PRs and issues open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run CI on more recent Java versions and different runtimes
3 participants