Skip to content

Commit

Permalink
ci: build with multiple jdk versions
Browse files Browse the repository at this point in the history
Signed-off-by: Joke de Buhr <joke@xckk.de>
  • Loading branch information
joke committed Mar 12, 2024
1 parent f02c335 commit 00b52fb
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
- uses: jdx/mise-action@v2
- uses: gradle/actions/setup-gradle@v3
- name: build
run: ./gradlew check
env:
ASDF_DATA_DIR: /home/runner/.local/share/mise
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ jobs:
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
- uses: jdx/mise-action@v2
- uses: gradle/actions/setup-gradle@v3
- name: publish
run: ./gradlew publish
env:
ASDF_DATA_DIR: /home/runner/.local/share/mise
ORG_GRADLE_PROJECT_OSSRHUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_OSSRHPassword: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_GitHubPackagesUsername: ${{ secrets.GITHUB_ACTOR }}
Expand Down
3 changes: 3 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://github.com/jdx/mise
[tools]
java = ['zulu-17.46.19', 'zulu-8.74.0.17']
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ allprojects { project ->
}

plugins.withType(JavaBasePlugin).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
}

plugins.withType(MavenPublishPlugin) {
Expand Down
34 changes: 20 additions & 14 deletions examples/springboot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,41 @@ versions.forEach {
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

dependencies {
compileOnly platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
compileOnly platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
compileOnly 'org.springframework.boot:spring-boot-starter-web'

testImplementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
testImplementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
testImplementation platform('org.codehaus.groovy:groovy-bom:3.0.21')
testImplementation platform('org.spockframework:spock-bom:2.1-groovy-3.0')
testImplementation project(':spock-outputcapture')
testImplementation 'org.slf4j:slf4j-simple'
testImplementation 'org.spockframework:spock-spring'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

spock20groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.18')) {
spock20groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.1')) {
exclude group: 'org.codehaus.groovy', module: '*'
}
spock20groovy25Implementation platform('org.codehaus.groovy:groovy-bom:2.5.23')
spock20groovy25Implementation platform('org.spockframework:spock-bom:2.0-groovy-2.5')
spock20groovy25Implementation enforcedPlatform('org.codehaus.groovy:groovy-bom:2.5.23')
spock20groovy25Implementation enforcedPlatform('org.spockframework:spock-bom:2.0-groovy-2.5')
spock20groovy25Implementation project(':spock-outputcapture')
spock20groovy25Implementation 'org.spockframework:spock-spring'
spock20groovy25Implementation 'org.springframework.boot:spring-boot-starter-test'

spock20groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
spock20groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
spock20groovy30Implementation platform('org.codehaus.groovy:groovy-bom:3.0.21')
spock20groovy30Implementation platform('org.spockframework:spock-bom:2.0-groovy-3.0')
spock20groovy30Implementation project(':spock-outputcapture')
spock20groovy30Implementation 'org.spockframework:spock-spring'
spock20groovy30Implementation 'org.springframework.boot:spring-boot-starter-test'

spock21groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.18')) {
spock21groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.1')) {
exclude group: 'org.codehaus.groovy', module: '*'
}
spock21groovy25Implementation platform('org.codehaus.groovy:groovy-bom:2.5.23')
Expand All @@ -54,14 +60,14 @@ dependencies {
spock21groovy25Implementation 'org.spockframework:spock-spring'
spock21groovy25Implementation 'org.springframework.boot:spring-boot-starter-test'

spock21groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
spock21groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
spock21groovy30Implementation platform('org.codehaus.groovy:groovy-bom:3.0.21')
spock21groovy30Implementation platform('org.spockframework:spock-bom:2.1-groovy-3.0')
spock21groovy30Implementation project(':spock-outputcapture')
spock21groovy30Implementation 'org.spockframework:spock-spring'
spock21groovy30Implementation 'org.springframework.boot:spring-boot-starter-test'

spock22groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.18')) {
spock22groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.1')) {
exclude group: 'org.codehaus.groovy', module: '*'
}
spock22groovy25Implementation platform('org.codehaus.groovy:groovy-bom:2.5.23')
Expand All @@ -70,21 +76,21 @@ dependencies {
spock22groovy25Implementation 'org.spockframework:spock-spring'
spock22groovy25Implementation 'org.springframework.boot:spring-boot-starter-test'

spock22groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
spock22groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
spock22groovy30Implementation platform('org.codehaus.groovy:groovy-bom:3.0.21')
spock22groovy30Implementation platform('org.spockframework:spock-bom:2.2-groovy-3.0')
spock22groovy30Implementation project(':spock-outputcapture')
spock22groovy30Implementation 'org.spockframework:spock-spring'
spock22groovy30Implementation 'org.springframework.boot:spring-boot-starter-test'

spock22groovy40Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
spock22groovy40Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
spock22groovy40Implementation platform('org.apache.groovy:groovy-bom:4.0.19')
spock22groovy40Implementation platform('org.spockframework:spock-bom:2.2-groovy-4.0')
spock22groovy40Implementation project(':spock-outputcapture')
spock22groovy40Implementation 'org.spockframework:spock-spring'
spock22groovy40Implementation 'org.springframework.boot:spring-boot-starter-test'

spock23groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.18')) {
spock23groovy25Implementation(platform('org.springframework.boot:spring-boot-dependencies:2.7.1')) {
exclude group: 'org.codehaus.groovy', module: '*'
}
spock23groovy25Implementation platform('org.codehaus.groovy:groovy-bom:2.5.23')
Expand All @@ -93,14 +99,14 @@ dependencies {
spock23groovy25Implementation 'org.spockframework:spock-spring'
spock23groovy25Implementation 'org.springframework.boot:spring-boot-starter-test'

spock23groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
spock23groovy30Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
spock23groovy30Implementation platform('org.codehaus.groovy:groovy-bom:3.0.21')
spock23groovy30Implementation platform('org.spockframework:spock-bom:2.3-groovy-3.0')
spock23groovy30Implementation project(':spock-outputcapture')
spock23groovy30Implementation 'org.spockframework:spock-spring'
spock23groovy30Implementation 'org.springframework.boot:spring-boot-starter-test'

spock23groovy40Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.18')
spock23groovy40Implementation platform('org.springframework.boot:spring-boot-dependencies:2.7.1')
spock23groovy40Implementation platform('org.apache.groovy:groovy-bom:4.0.19')
spock23groovy40Implementation platform('org.spockframework:spock-bom:2.3-groovy-4.0')
spock23groovy40Implementation project(':spock-outputcapture')
Expand Down
6 changes: 6 additions & 0 deletions spock-outputcapture/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ dependencies {
compileOnly 'org.spockframework:spock-core'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

publishing {
publications {
spockOutputCapture(MavenPublication) {
Expand Down

0 comments on commit 00b52fb

Please sign in to comment.