Skip to content

Commit

Permalink
Execute integration tests with (LTS) Java versions
Browse files Browse the repository at this point in the history
After building with JDK 8 we should check whether
everything runs with other current JDK LTS + latest
versions.
  • Loading branch information
ascheman committed Feb 2, 2024
1 parent 318bc16 commit 7dcd85c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
# Always build with JDK 8 initially
java-version: 8

- name: Setup Gradle
Expand All @@ -19,7 +20,7 @@ jobs:
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}

- name: Execute Gradle build
run: ./gradlew clean check integrationTest --scan -stacktrace
run: ./gradlew clean check integrationTest --scan --stacktrace

- name: 'Publish Test Results'
uses: EnricoMi/publish-unit-test-result-action/composite@v2
Expand All @@ -35,3 +36,20 @@ jobs:
coverage_report_name: Coverage
coverage_report_title: JaCoCo
github_token: ${{ secrets.GITHUB_TOKEN }}

test-java-versions:
strategy:
matrix:
java-test-version: [ 11, 17, 21, 22 ]
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-java@v3
with:
distribution: temurin
# Always build with JDK 8 initially
java-version: ${{ matrix.java-test-version }}
- name: Execute integration test
run: |
find build/maven-repo -type f -ls
./gradlew --version
./gradlew integrationTestOnly
15 changes: 12 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ configure(subprojects) {
// apply plugin: 'codenarc'
}

tasks.register("integrationTest") {
tasks.register("integrationTestOnly") {
group("Verification")
description("Run overall integration tests")
description("Run overall integration tests (no publish)")

final String INTEGRATION_TEST_DIRECTORY = "integration-test/gradle-plugin"

Expand All @@ -108,10 +108,19 @@ tasks.register("integrationTest") {
assert testIndex.exists()
}
}
integrationTest.dependsOn(
integrationTestOnly.mustRunAfter(
':htmlSanityCheck-core:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository',
':htmlSanityCheck-gradle-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository'
)
tasks.register("integrationTest") {
group("Verification")
description("Run overall integration tests (and publish first)")
}
integrationTest.dependsOn(
':htmlSanityCheck-core:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository',
':htmlSanityCheck-gradle-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository',
'integrationTestOnly'
)

/*
* Copyright Gernot Starke and aim42 contributors.
Expand Down

0 comments on commit 7dcd85c

Please sign in to comment.