Skip to content

Commit 87bf674

Browse files
committed
Run JDK tests using invoker.javaHome on GitHub Actions
That way, we always build the project with the same JDK (except for specific jobs: Windows, and publishing the snapshot), and only change the JDK for the IT tests.
1 parent 4c98eae commit 87bf674

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,8 @@ jobs:
8585
java-version: ${{ matrix.java }}
8686
distribution: temurin
8787

88-
- name: Setup JAVA_HOME_${{ matrix.java }}_X64 environment variable
89-
run: echo "JAVA_HOME_${{ matrix.java }}_X64=${{ steps.setup-test-java.outputs.path }}" | tee -a $GITHUB_ENV
90-
91-
# TODO: investigate only running IT tests with that JDK, rather than the whole build, through Toolchains
9288
- name: Setup environment
93-
run: echo "JAVA_HOME=${JAVA_HOME_${{ matrix.java }}_X64}" | tee -a $GITHUB_ENV
89+
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" | tee -a $GITHUB_ENV
9490

9591
- name: Cache Maven dependencies
9692
uses: actions/cache@v3
@@ -104,7 +100,7 @@ jobs:
104100

105101
- name: Build with Maven
106102
id: maven-build
107-
run: mvn -B -U -ntp verify --fail-at-end
103+
run: mvn -B -U -ntp verify --fail-at-end "-Dinvoker.javaHome=${{ steps.setup-test-java.outputs.path }}"
108104

109105
- name: Store reports
110106
if: steps.maven-build.outcome == 'success' || steps.maven-build.outcome == 'failure'

0 commit comments

Comments
 (0)