Skip to content

Commit e22a950

Browse files
committed
gh-action: separate java17 test jobs
Signed-off-by: yue9944882 <[email protected]>
1 parent 9c09e7c commit e22a950

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

.github/workflows/maven.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ jobs:
2323
- name: Verify Format and License
2424
run: mvn spotless:check
2525
build:
26-
name: Java ${{ matrix.java }} Maven Test on ${{ matrix.os }}
26+
name: Legacy Java ${{ matrix.java }} Maven Test on ${{ matrix.os }}
2727
strategy:
2828
matrix:
29-
# Test against the LTS Java versions. TODO: add JDK18 when it becomes available.
30-
java: [ 8.0.x, 11.0.x, 17.0.x ]
29+
java: [ 8.0.x, 11.0.x ]
3130
os: [ macos-latest, windows-latest, ubuntu-latest ]
3231
runs-on: ${{ matrix.os }}
3332
steps:
@@ -43,8 +42,14 @@ jobs:
4342
path: ~/.m2/repository
4443
key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }}
4544
- name: Build with Maven
45+
shell: bash
4646
run: |
47-
mvn clean test -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
47+
if [ $(grep -E '^(8|11)\.' <<< '${{ matrix.java }}') ]; then
48+
# some module doesn't compile on java platform lower than 17, need to skip them by specifying a profile
49+
mvn clean test -q -B -Pcompatibility-before-java17 --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
50+
else
51+
mvn clean test -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
52+
fi
4853
build-graalvm:
4954
runs-on: ubuntu-latest
5055
name: GraalVM Maven Test

pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,5 +561,21 @@ limitations under the License.
561561
<module>fluent-gen</module>
562562
</modules>
563563
</profile>
564+
<profile>
565+
<id>compatibility-before-java17</id>
566+
<modules>
567+
<module>util</module>
568+
<module>kubernetes</module>
569+
<module>proto</module>
570+
<module>extended</module>
571+
<module>fluent</module>
572+
<module>spring</module>
573+
<module>e2e</module>
574+
<module>examples</module>
575+
<module>client-java-contrib/cert-manager</module>
576+
<module>client-java-contrib/prometheus-operator</module>
577+
<module>client-java-contrib/admissionreview</module>
578+
</modules>
579+
</profile>
564580
</profiles>
565581
</project>

0 commit comments

Comments
 (0)