From 4d575d90510ebc9a6490902fb9eebbe34b25d7e3 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Wed, 24 Nov 2021 15:11:32 +0100 Subject: [PATCH] ci: Update pipelines to verify compilation on Java 17 Signed-off-by: Marc Nuri --- .github/workflows/build.yml | 2 +- .github/workflows/sonar.yml | 4 ++-- .github/workflows/windows-build.yml | 7 ++++--- .../fabric8/kubernetes/client/utils/SerializationTest.java | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7903e21c89d..f3737c0d0b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8,11] + java: [8,17] steps: - name: Checkout uses: actions/checkout@v2.4.0 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 85fe873a733..dbf7ace18d5 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -43,10 +43,10 @@ jobs: with: # Shallow clones should be disabled for a better relevancy of analysis fetch-depth: 0 - - name: Setup Java 11 # Move Sonar analysis to Java 11 + - name: Setup Java 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'temurin' - name: Maven Sonar run: mvn ${MAVEN_ARGS} clean install sonar:sonar -Psonar diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index c2ed4e9d4e0..6552daa56f6 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -33,14 +33,15 @@ jobs: runs-on: windows-latest strategy: matrix: - java: [11] + java: [17] steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v2 - name: Setup Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: java-version: ${{ matrix.java }} + distribution: 'temurin' - name: Build Project run: mvn clean install diff --git a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/SerializationTest.java b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/SerializationTest.java index 5bf5f9ac84a..da09c355838 100644 --- a/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/SerializationTest.java +++ b/kubernetes-client/src/test/java/io/fabric8/kubernetes/client/utils/SerializationTest.java @@ -162,7 +162,7 @@ void testSerializeYamlWithAlias() { .isNotNull() .hasFieldOrPropertyWithValue("metadata.name", "test-pod-with-alias") .hasFieldOrPropertyWithValue("spec.nodeSelector.workload", "build") - .hasFieldOrPropertyWithValue("spec.tolerations.size", 1) + .returns(1, p -> p.getSpec().getTolerations().size()) .hasFieldOrPropertyWithValue("spec.securityContext.runAsGroup", 1000L) .hasFieldOrPropertyWithValue("spec.securityContext.runAsUser", 1000L) .extracting(Pod::getSpec).extracting(PodSpec::getContainers).asList() @@ -311,11 +311,11 @@ void nullValueShouldNotBeOutput() { .doesNotContain("status") .contains("spec: \"foo\""); } - + @Test void quantityQuoting() { Quantity quantity = Serialization.unmarshal("amount: \"2\"\nformat: \"Gi\"", Quantity.class); assertThat(Serialization.asYaml(quantity)).isEqualTo("--- \"2Gi\"\n"); } - + }