Skip to content

Commit b859f45

Browse files
committed
test-infra: merges github action test scripts and bumps jdk
Signed-off-by: yue9944882 <[email protected]>
1 parent 6f04a47 commit b859f45

File tree

2 files changed

+16
-42
lines changed

2 files changed

+16
-42
lines changed

.github/workflows/maven.yml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,12 @@ jobs:
2222
java-version: 8.0.x
2323
- name: Verify Format and License
2424
run: mvn spotless:check
25-
legacy-build:
26-
name: Legacy Java ${{ matrix.java }} Maven Test on ${{ matrix.os }}
27-
strategy:
28-
matrix:
29-
java: [ 8.0.x, 11.0.x ]
30-
os: [ macos-latest, windows-latest, ubuntu-latest ]
31-
runs-on: ${{ matrix.os }}
32-
steps:
33-
- uses: actions/checkout@v3
34-
- name: Setup Java
35-
uses: actions/setup-java@v3
36-
with:
37-
distribution: 'temurin'
38-
java-version: ${{ matrix.java }}
39-
- name: Cache local Maven repository
40-
uses: actions/cache@v3
41-
with:
42-
path: ~/.m2/repository
43-
key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }}
44-
- name: Build with Maven
45-
run: |
46-
mvn clean test -q -B -Pcompatibility-before-java17 --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
4725
build:
4826
name: Java ${{ matrix.java }} Maven Test on ${{ matrix.os }}
4927
strategy:
5028
matrix:
5129
# Test against the LTS Java versions. TODO: add JDK18 when it becomes available.
52-
java: [ 17.0.x ]
30+
java: [ 8.0.x, 11.0.x, 17.0.x ]
5331
os: [ macos-latest, windows-latest, ubuntu-latest ]
5432
runs-on: ${{ matrix.os }}
5533
steps:
@@ -65,16 +43,23 @@ jobs:
6543
path: ~/.m2/repository
6644
key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }}
6745
- name: Build with Maven
46+
shell: bash
6847
run: |
69-
mvn clean test -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
48+
if [ $(grep -E '^(8|11)\.' <<< '${{ matrix.java }}') ]; then
49+
# some module doesn't compile on java platform lower than 17, need to skip them by specifying a profile
50+
MODS_OVERRIDES='-pl !spring-aot'
51+
fi
52+
mvn -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $MODS_OVERRIDES clean test
7053
build-graalvm:
7154
runs-on: ubuntu-latest
7255
name: GraalVM Maven Test
7356
steps:
7457
- uses: actions/checkout@v3
75-
- uses: DeLaGuardo/setup-graalvm@48f2bf339ab7d35e31029b1822a213681fdfc42e
58+
- uses: graalvm/setup-graalvm@v1
7659
with:
77-
graalvm-version: '19.3.0.java8'
60+
version: '22.3.0'
61+
java-version: '17'
62+
components: 'native-image'
7863
- name: Build with Maven
7964
run: mvn -q test -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
8065
e2e:
@@ -84,6 +69,11 @@ jobs:
8469
- uses: actions/checkout@v3
8570
- name: Create k8s Kind Cluster
8671
uses: helm/[email protected]
72+
- name: Setup Java
73+
uses: actions/setup-java@v3
74+
with:
75+
distribution: 'temurin'
76+
java-version: 17.0.x
8777
- name: Run E2E with Maven
8878
run: |
8979
mvn clean install \

pom.xml

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

0 commit comments

Comments
 (0)