diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index e0cb3c2e..75ba39c9 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -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 @@ -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 @@ -35,3 +36,21 @@ jobs: coverage_report_name: Coverage coverage_report_title: JaCoCo github_token: ${{ secrets.GITHUB_TOKEN }} + + test-java-versions: + needs: gradle + strategy: + matrix: + java-test-version: [ 11, 17, 21 ] + 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 diff --git a/build.gradle b/build.gradle index f7c886fe..731f4815 100644 --- a/build.gradle +++ b/build.gradle @@ -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" @@ -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.