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

CI/CD Improvements #1

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
445932d
Update Gradle wrapper from 7.1 to 7.3.3
jord1e Jan 30, 2022
833bf7e
Make builds partially compatible with Java 8..17
jord1e Jan 31, 2022
fe0b2db
Test new CI file
jord1e Jan 31, 2022
2b73a1c
Test new CI file 2
jord1e Jan 31, 2022
4146505
Test new CI file 3
jord1e Jan 31, 2022
2245843
Test new CI file 4
jord1e Jan 31, 2022
61755e9
Test new CI file 5
jord1e Jan 31, 2022
ef7ce6f
Test new CI file 6
jord1e Jan 31, 2022
5bd2ba3
Test new CI file 7
jord1e Jan 31, 2022
05c73a3
Correct environment variables
jord1e Jan 31, 2022
7e69fcd
Test
jord1e Jan 31, 2022
ac7747b
Test
jord1e Jan 31, 2022
fa01876
Test
jord1e Jan 31, 2022
5d6adb8
Test
jord1e Jan 31, 2022
a1522d8
Test
jord1e Jan 31, 2022
5053eb3
Test
jord1e Jan 31, 2022
58b6eb5
Test
jord1e Jan 31, 2022
bdcdb3c
Test
jord1e Jan 31, 2022
3178fdc
Test
jord1e Jan 31, 2022
fd940e0
Test
jord1e Jan 31, 2022
90c43b2
Test
jord1e Jan 31, 2022
ddcb61a
Test OpenJ9
jord1e Jan 31, 2022
b524fae
Test OpenJ9 2
jord1e Jan 31, 2022
a8f6657
Test
jord1e Jan 31, 2022
eff359e
Test
jord1e Jan 31, 2022
aa3c723
Earlier java 8
jord1e Jan 31, 2022
674d2a1
Earlier java 8 2
jord1e Jan 31, 2022
92ef37c
test
jord1e Jan 31, 2022
15e1621
test
jord1e Jan 31, 2022
96cd7c5
Merge branch 'master' into ci-improvements
jord1e Feb 1, 2022
9d03567
Change versions
jord1e Feb 1, 2022
a1f4f84
java 16
jord1e Feb 1, 2022
45c74bc
Ignore failing windows test temporarily
jord1e Feb 1, 2022
67bdae5
Ignore failing windows test temporarily (proper test this time)
jord1e Feb 1, 2022
a6d8dae
Merge branch 'master' into ci-improvements
jord1e Feb 11, 2022
40acc4b
oops
jord1e Feb 11, 2022
8d3b8af
Merge branch 'master' into ci-improvements
jord1e Apr 9, 2022
a6fa239
Updates
jord1e Apr 9, 2022
5b0e362
Updates
jord1e Apr 9, 2022
2c8d6bb
Updates
jord1e Apr 9, 2022
4b98e68
Ignore tests
jord1e Apr 9, 2022
342c395
Should pass
jord1e Apr 9, 2022
e5ce6d1
Reset baseline to java 8
jord1e Apr 9, 2022
7336115
Merge branch 'master' into ci-improvements
jord1e Jul 29, 2022
83ffada
Fix tests
jord1e Jul 29, 2022
55fed54
Merge branch 'master' into ci-improvements
jord1e Oct 27, 2023
88fb85f
Update Gradle to 8.4
jord1e Oct 27, 2023
4e12c3c
Fixup CI scripts
jord1e Oct 27, 2023
f23a24f
Fixup test summary archive naming
jord1e Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
push:
branches:
- master

jobs:
buildAndPublish:
runs-on: ubuntu-latest
env:
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
MAVEN_CENTRAL_PGP_KEY: ${{ secrets.MAVEN_CENTRAL_PGP_KEY }}

steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
Expand All @@ -20,5 +20,15 @@ jobs:
with:
java-version: '11'
distribution: 'corretto'
- name: build test and publish
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace
- 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
51 changes: 44 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Request Build
name: PR Verify
# For pull requests: builds and test
on:
push:
Expand All @@ -11,16 +11,53 @@ on:
- 19.x
- 18.x
- 17.x

jobs:
buildAndTest:
runs-on: ubuntu-latest
name: buildAndTest ${{ matrix.java }} (${{ matrix.dist }}) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
java: [ '11', '17', '21' ]
dist: [ 'temurin', 'semeru' ]
exclude:
- # Unsupported
os: 'ubuntu-latest'
java: '21'
dist: 'semeru'
- # Unsupported
os: 'windows-latest'
java: '21'
dist: 'semeru'
env:
ORG_GRADLE_PROJECT_javaVersion: ${{ matrix.java }}
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 11
- name: Set up JDK (${{ matrix.java }}, ${{ matrix.dist }})
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'corretto'
- name: build and test
run: ./gradlew assemble && ./gradlew check --info --stacktrace
java-version: ${{ matrix.java }}
distribution: ${{ matrix.dist }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: --version
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: assemble
- name: Test
uses: gradle/gradle-build-action@v2
with:
arguments: check --info --stacktrace
- name: Archive Gradle Test Summary
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: gradle-test-summary-${{ matrix.java }}-${{ matrix.dist }}-${{ matrix.os }}
path: build/reports/tests/test/
retention-days: 5
if-no-files-found: ignore
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
RELEASE_VERSION: ${{ github.event.inputs.version }}

steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
Expand All @@ -24,5 +23,15 @@ jobs:
with:
java-version: '11'
distribution: 'corretto'
- name: build test and publish
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace
- 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
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ plugins {
id "me.champeau.jmh" version "0.7.1"
}

final String javaVersion = project.hasProperty("javaVersion") ?
(project.property("javaVersion") as String).replaceAll("^([0-9]+).*", "\$1")
: null
if (javaVersion == null) {
throw new Throwable("Please define a javaVersion in your gradle.properties")
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ org.gradle.caching=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8

javaVersion=11
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ pluginManagement {
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
}

rootProject.name = 'graphql-java'
5 changes: 5 additions & 0 deletions src/test/groovy/graphql/parser/LineNumberingTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package graphql.parser
import graphql.language.Field
import graphql.language.FragmentDefinition
import graphql.language.OperationDefinition
import org.spockframework.runtime.extension.builtin.PreconditionContext
import spock.lang.IgnoreIf
import spock.lang.Issue
import spock.lang.Specification
import spock.lang.Unroll

Expand Down Expand Up @@ -44,6 +47,8 @@ fragment X on Book {

}

@Issue("https://github.com/graphql-java/graphql-java/issues/2709")
@IgnoreIf({ PreconditionContext it -> it.jvm.java16Compatible })
def "multi source line numbering works as expected"() {
def queryBit1 = '''query X {
field1
Expand Down
7 changes: 7 additions & 0 deletions src/test/groovy/graphql/parser/MultiSourceReaderTest.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package graphql.parser

import org.spockframework.runtime.extension.builtin.PreconditionContext
import spock.lang.IgnoreIf
import spock.lang.Issue
import spock.lang.Specification

class MultiSourceReaderTest extends Specification {
Expand All @@ -10,6 +13,8 @@ class MultiSourceReaderTest extends Specification {
multiSource.close()
}

// Does not work on Windows
@IgnoreIf({ PreconditionContext it -> it.os.windows })
def "can combine files"() {
when:
multiSource = MultiSourceReader.newMultiSourceReader()
Expand Down Expand Up @@ -157,6 +162,8 @@ B5*******X
multiSource.getOverallLineNumber() == 0
}

@Issue("https://github.com/graphql-java/graphql-java/issues/2709")
@IgnoreIf({ PreconditionContext it -> it.jvm.java16Compatible })
def "can handle null source name"() {
def sr = new StringReader("Hello\nWorld")
when:
Expand Down
5 changes: 5 additions & 0 deletions src/test/groovy/graphql/parser/ParserExceptionTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package graphql.parser
import graphql.GraphQL
import graphql.InvalidSyntaxError
import graphql.StarWarsSchema
import org.spockframework.runtime.extension.builtin.PreconditionContext
import spock.lang.IgnoreIf
import spock.lang.Issue
import spock.lang.Specification

class ParserExceptionTest extends Specification {
Expand Down Expand Up @@ -46,6 +49,8 @@ fragment X on SomeType {
'''
}

@Issue("https://github.com/graphql-java/graphql-java/issues/2709")
@IgnoreIf({ PreconditionContext it -> it.jvm.java16Compatible })
def "can work with multi source input"() {
when:
def multiSource = MultiSourceReader.newMultiSourceReader()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import graphql.parser.MultiSourceReader
import graphql.schema.GraphQLTypeUtil
import graphql.schema.idl.errors.SchemaProblem
import graphql.schema.idl.errors.SchemaRedefinitionError
import org.spockframework.runtime.extension.builtin.PreconditionContext
import spock.lang.IgnoreIf
import spock.lang.Issue
import spock.lang.Specification
import spock.lang.Unroll

Expand Down Expand Up @@ -1077,6 +1080,8 @@ class TypeDefinitionRegistryTest extends Specification {
"Foo", "Bar", "FooScalar", "FooDirective", "Extra", "ExtraInterface"]
}

@Issue("https://github.com/graphql-java/graphql-java/issues/2709")
@IgnoreIf({ PreconditionContext it -> it.jvm.java16Compatible })
def "multi source reader works"() {

def sdl1 = '''
Expand Down
66 changes: 33 additions & 33 deletions src/test/groovy/graphql/util/AnonymizerTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -723,39 +723,39 @@ type Object1 {

then:
newSchema == """\
schema @Directive1(argument1 : "stringValue1"){
query: Object1
}
directive @Directive1(argument1: String! = "stringValue4") repeatable on SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
interface Interface1 @Directive1(argument1 : "stringValue12") {
field2: String
field3: Enum1
}
union Union1 @Directive1(argument1 : "stringValue21") = Object2
type Object1 @Directive1(argument1 : "stringValue8") {
field1: Interface1 @Directive1(argument1 : "stringValue9")
field4: Union1 @deprecated
}
type Object2 implements Interface1 {
field2: String
field3: Enum1
field5(argument2: InputObject1): String
}
enum Enum1 @Directive1(argument1 : "stringValue15") {
EnumValue1 @Directive1(argument1 : "stringValue18")
EnumValue2
}
input InputObject1 @Directive1(argument1 : "stringValue24") {
inputField1: Int @Directive1(argument1 : "stringValue27")
}
""".stripIndent()
schema @Directive1(argument1 : "stringValue1"){
query: Object1
}

directive @Directive1(argument1: String! = "stringValue4") repeatable on SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION

interface Interface1 @Directive1(argument1 : "stringValue12") {
field2: String
field3: Enum1
}

union Union1 @Directive1(argument1 : "stringValue21") = Object2

type Object1 @Directive1(argument1 : "stringValue8") {
field1: Interface1 @Directive1(argument1 : "stringValue9")
field4: Union1 @deprecated
}

type Object2 implements Interface1 {
field2: String
field3: Enum1
field5(argument2: InputObject1): String
}

enum Enum1 @Directive1(argument1 : "stringValue15") {
EnumValue1 @Directive1(argument1 : "stringValue18")
EnumValue2
}

input InputObject1 @Directive1(argument1 : "stringValue24") {
inputField1: Int @Directive1(argument1 : "stringValue27")
}
"""
}

def "query with directives"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,21 @@ class ExecutableDefinitionsTest extends Specification {

def 'Executable Definitions with type definition'() {
def query = """
query Foo {
dog {
name
}
}

type Cow {
name: String
}

extend type Dog {
color: String
}
""".stripIndent()
query Foo {
dog {
name
}
}

type Cow {
name: String
}

extend type Dog {
color: String
}
"""

when:
def validationErrors = validate(query)

Expand All @@ -77,14 +78,15 @@ class ExecutableDefinitionsTest extends Specification {

def 'Executable Definitions with schema definition'() {
def query = """
schema {
query: QueryRoot
}

type QueryRoot {
test: String
}
""".stripIndent()
schema {
query: QueryRoot
}

type QueryRoot {
test: String
}
"""

when:
def validationErrors = validate(query)

Expand Down Expand Up @@ -118,7 +120,7 @@ class ExecutableDefinitionsTest extends Specification {

def 'Executable Definitions with no directive definition'() {
def query = """
directive @nope on INPUT_OBJECT
directive @nope on INPUT_OBJECT
""".stripIndent()
when:
def document = new Parser().parseDocument(query)
Expand Down
Loading