Skip to content

Commit

Permalink
test-infra: merges github action test scripts and bumps jdk
Browse files Browse the repository at this point in the history
Signed-off-by: yue9944882 <291271447@qq.com>
  • Loading branch information
yue9944882 committed Nov 28, 2022
1 parent 6f04a47 commit 3d710de
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 44 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
44 changes: 17 additions & 27 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,12 @@ jobs:
java-version: 8.0.x
- name: Verify Format and License
run: mvn spotless:check
legacy-build:
name: Legacy Java ${{ matrix.java }} Maven Test on ${{ matrix.os }}
strategy:
matrix:
java: [ 8.0.x, 11.0.x ]
os: [ macos-latest, windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }}
- name: Build with Maven
run: |
mvn clean test -q -B -Pcompatibility-before-java17 --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
build:
name: Java ${{ matrix.java }} Maven Test on ${{ matrix.os }}
strategy:
matrix:
# Test against the LTS Java versions. TODO: add JDK18 when it becomes available.
java: [ 17.0.x ]
java: [ 8.0.x, 11.0.x, 17.0.x ]
os: [ macos-latest, windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -65,16 +43,23 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ matrix.java }}-${{ hashFiles('pom.xml', '**/pom.xml') }}
- name: Build with Maven
shell: bash
run: |
mvn clean test -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
if [ $(grep -E '^(8|11)\.' <<< '${{ matrix.java }}') ]; then
# some module doesn't compile on java platform lower than 17, need to skip them by specifying a profile
MODS_OVERRIDES='-pl !spring-aot'
fi
mvn -q -B --define=org.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn $MODS_OVERRIDES clean test
build-graalvm:
runs-on: ubuntu-latest
name: GraalVM Maven Test
steps:
- uses: actions/checkout@v3
- uses: DeLaGuardo/setup-graalvm@48f2bf339ab7d35e31029b1822a213681fdfc42e
- uses: graalvm/setup-graalvm@v1
with:
graalvm-version: '19.3.0.java8'
version: '22.3.0'
java-version: '17'
components: 'native-image'
- name: Build with Maven
run: mvn -q test -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
e2e:
Expand All @@ -84,6 +69,11 @@ jobs:
- uses: actions/checkout@v3
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.4.0
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.x
- name: Run E2E with Maven
run: |
mvn clean install \
Expand All @@ -103,7 +93,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11.0.x
java-version: 17.0.x
- name: Cache local Maven repository
uses: actions/cache@v3
with:
Expand Down
16 changes: 0 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -563,21 +563,5 @@ limitations under the License.
<module>fluent-gen</module>
</modules>
</profile>
<profile>
<id>compatibility-before-java17</id>
<modules>
<module>util</module>
<module>kubernetes</module>
<module>proto</module>
<module>extended</module>
<module>fluent</module>
<module>spring</module>
<module>e2e</module>
<module>examples</module>
<module>client-java-contrib/cert-manager</module>
<module>client-java-contrib/prometheus-operator</module>
<module>client-java-contrib/admissionreview</module>
</modules>
</profile>
</profiles>
</project>

0 comments on commit 3d710de

Please sign in to comment.