From d44edfc2081e17fd66f318ff1d8d3ea1da27ab36 Mon Sep 17 00:00:00 2001 From: erabii Date: Wed, 17 Apr 2024 18:46:43 +0300 Subject: [PATCH] Drop jdk8 build support + various improvements (#1638) --- .../action.yaml | 6 +-- .../action.yaml | 2 +- .../composites/pre-test-actions/action.yaml | 6 +-- .../restore-docker-images/action.yaml | 2 - .../action.yaml | 48 +++++-------------- .../action.yaml | 10 ++-- .../composites/setup-jdk1.8/action.yaml | 9 ---- .../composites/setup-jdk17/action.yaml | 2 +- .../composites/test-times/action.yaml | 9 +--- .github/workflows/maven.yaml | 32 ++++--------- 10 files changed, 31 insertions(+), 95 deletions(-) delete mode 100755 .github/workflows/composites/setup-jdk1.8/action.yaml diff --git a/.github/workflows/composites/matrix-bounds-on-test-times-cache-hit/action.yaml b/.github/workflows/composites/matrix-bounds-on-test-times-cache-hit/action.yaml index 4badaf1b57..d79b978389 100644 --- a/.github/workflows/composites/matrix-bounds-on-test-times-cache-hit/action.yaml +++ b/.github/workflows/composites/matrix-bounds-on-test-times-cache-hit/action.yaml @@ -19,7 +19,7 @@ runs: steps: - name: restore test times cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: /tmp/sorted.txt key: ${{ runner.os }}-spring-cloud-k8s-existing-test-times-cache-${{ github.run_id }} @@ -117,13 +117,13 @@ runs: echo "AVERAGE_TIME_PER_INSTANCE=$(echo $average_time_per_instance_json)" >> $GITHUB_ENV - name: upload test with times - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tests-with-times-sorted.txt path: /tmp/tests-with-times-sorted.txt - name: upload test without times - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tests-without-times.txt path: /tmp/tests-without-times.txt diff --git a/.github/workflows/composites/maven-build-with-dry-run-for-tests/action.yaml b/.github/workflows/composites/maven-build-with-dry-run-for-tests/action.yaml index 202705c0d4..6a4b927ab1 100644 --- a/.github/workflows/composites/maven-build-with-dry-run-for-tests/action.yaml +++ b/.github/workflows/composites/maven-build-with-dry-run-for-tests/action.yaml @@ -30,7 +30,7 @@ runs: run: cat /tmp/tests.txt - name: upload test - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: tests.txt path: /tmp/tests.txt diff --git a/.github/workflows/composites/pre-test-actions/action.yaml b/.github/workflows/composites/pre-test-actions/action.yaml index 0f12bad67a..2b372d2737 100644 --- a/.github/workflows/composites/pre-test-actions/action.yaml +++ b/.github/workflows/composites/pre-test-actions/action.yaml @@ -15,10 +15,6 @@ runs: uses: ./.github/workflows/composites/setup-jdk17 if: env.BASE_BRANCH == 'main' - - name: setup project jdk-8 - uses: ./.github/workflows/composites/setup-jdk1.8 - if: env.BASE_BRANCH == '2.1.x' - - name: cache local maven repository uses: ./.github/workflows/composites/cache @@ -37,7 +33,7 @@ runs: uses: ./.github/workflows/composites/build-integration-tests-project - name: download tests - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: tests.txt path: /tmp diff --git a/.github/workflows/composites/restore-docker-images/action.yaml b/.github/workflows/composites/restore-docker-images/action.yaml index c5a41a8592..f6d77c5cf0 100644 --- a/.github/workflows/composites/restore-docker-images/action.yaml +++ b/.github/workflows/composites/restore-docker-images/action.yaml @@ -31,7 +31,6 @@ runs: with: path: | /tmp/docker/images - key: docker-images-github-cache-${{ hashFiles('**/current-images.txt') }} - name: print images shell: bash @@ -39,4 +38,3 @@ runs: echo 'printing images' ls /tmp/docker/images - diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml index d262d89bbd..786cd0ce95 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-missing/action.yaml @@ -37,39 +37,17 @@ runs: TEST_ARG=$(echo ${sliced_array[@]} | sed 's/ /,/g') echo "$TEST_ARG" - if [[ $baseBranch == "2.1.x" ]]; then - - ./mvnw -s .settings.xml -pl '-:kubernetes-leader-election-example' -pl '-:kubernetes-hello-world-example' \ - -pl '-:kubernetes-reload-example' -pl '-:kubernetes-loadbalancer-example' \ - -pl '-:spring-cloud-kubernetes-configserver' -pl '-:spring-cloud-kubernetes-configuration-watcher' \ - -pl '-:spring-cloud-kubernetes-discoveryserver' \ - -DtestsToRun=${TEST_ARG[@]} \ - -e clean install \ - -U -P sonar -nsu --batch-mode \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dhttp.keepAlive=false \ - -Dmaven.wagon.http.pool=false \ - -Dmaven.wagon.http.retryHandler.class=standard \ - -Dmaven.wagon.http.retryHandler.count=3 \ - -Dskip.build.image=true - - else - - version=$(java -version) - echo "version of java: $version" - - ./mvnw -s .settings.xml \ - -DtestsToRun=${TEST_ARG[@]} \ - -DCURRENT_INSTANCE=${CURRENT_INDEX} \ - -e clean install \ - -P sonar -nsu --batch-mode \ - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ - -Dhttp.keepAlive=false \ - -Dmaven.wagon.http.pool=false \ - -Dmaven.wagon.http.retryHandler.class=standard \ - -Dmaven.wagon.http.retryHandler.count=3 \ - -Dskip.build.image=true - fi + ./mvnw -s .settings.xml \ + -DtestsToRun=${TEST_ARG[@]} \ + -DCURRENT_INSTANCE=${CURRENT_INDEX} \ + -e clean install \ + -P sonar -nsu --batch-mode \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + -Dhttp.keepAlive=false \ + -Dmaven.wagon.http.pool=false \ + -Dmaven.wagon.http.retryHandler.class=standard \ + -Dmaven.wagon.http.retryHandler.count=3 \ + -Dskip.build.image=true touch /tmp/test_times_${{ env.CURRENT_INDEX }}.txt @@ -85,12 +63,10 @@ runs: - name: show individual test times shell: bash - if: env.BASE_BRANCH != '2.1.x' run: cat /tmp/test_times_${{ env.CURRENT_INDEX }}.txt - name: upload individual tests - if: env.BASE_BRANCH != '2.1.x' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test_times_${{ env.CURRENT_INDEX }}.txt path: /tmp/test_times_${{ env.CURRENT_INDEX }}.txt diff --git a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml index c81655555f..15fb3abd1b 100644 --- a/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml +++ b/.github/workflows/composites/run-and-save-test-times-when-cache-present/action.yaml @@ -6,15 +6,13 @@ runs: steps: - name: download tests with times - if: env.BASE_BRANCH != '2.1.x' - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: tests-with-times-sorted.txt path: /tmp/ - name: download tests without times - if: env.BASE_BRANCH != '2.1.x' - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: tests-without-times.txt path: /tmp/ @@ -187,12 +185,10 @@ runs: - name: show individual test times shell: bash - if: env.BASE_BRANCH != '2.1.x' run: cat /tmp/test_times_${{ env.CURRENT_INDEX }}.txt - name: upload individual tests - if: env.BASE_BRANCH != '2.1.x' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test_times_${{ env.CURRENT_INDEX }}.txt path: /tmp/test_times_${{ env.CURRENT_INDEX }}.txt diff --git a/.github/workflows/composites/setup-jdk1.8/action.yaml b/.github/workflows/composites/setup-jdk1.8/action.yaml deleted file mode 100755 index 7dab637584..0000000000 --- a/.github/workflows/composites/setup-jdk1.8/action.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: setup project with jdk-8 -description: setup project with jdk-8 -runs: - using: "composite" - steps: - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '8' diff --git a/.github/workflows/composites/setup-jdk17/action.yaml b/.github/workflows/composites/setup-jdk17/action.yaml index 19dcd374ab..1e491f1e73 100755 --- a/.github/workflows/composites/setup-jdk17/action.yaml +++ b/.github/workflows/composites/setup-jdk17/action.yaml @@ -3,7 +3,7 @@ description: setup project with jdk-17 runs: using: "composite" steps: - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' diff --git a/.github/workflows/composites/test-times/action.yaml b/.github/workflows/composites/test-times/action.yaml index 33d2c13bfe..1fa1bd4170 100644 --- a/.github/workflows/composites/test-times/action.yaml +++ b/.github/workflows/composites/test-times/action.yaml @@ -15,18 +15,15 @@ runs: # we omit the name, as such all artifacts are downloaded - name: download all artifacts - if: env.BASE_BRANCH != '2.1.x' - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: /tmp/all-artifacts - name: show all artifacts - if: env.BASE_BRANCH != '2.1.x' shell: bash run: ls -l /tmp/all-artifacts - name: merge all artifacts into a single file and sort by time - if: env.BASE_BRANCH != '2.1.x' shell: bash run: | arr=($(find /tmp/all-artifacts/ -type f -name "test_times*")) @@ -41,7 +38,6 @@ runs: cat /tmp/sorted.txt - name: show all tests in a sorted manner - if: env.BASE_BRANCH != '2.1.x' shell: bash run: cat /tmp/sorted.txt @@ -51,8 +47,7 @@ runs: # meaning there could be many of them already present and this is not an exact match # github in this case will pick up the latest one, exactly what we want. - name: save test times in cache - uses: actions/cache/save@v3 - if: env.BASE_BRANCH != '2.1.x' + uses: actions/cache/save@v4 with: path: /tmp/sorted.txt key: ${{ runner.os }}-spring-cloud-k8s-existing-test-times-cache-${{ github.run_id }} diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index fd2779105d..a68e5d45a8 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -2,9 +2,9 @@ name: github-workflow on: push: - branches: [ main, 2.1.x, 3.0.x ] + branches: [ main, 3.0.x ] pull_request: - branches: [ main, 2.1.x, 3.0.x ] + branches: [ main, 3.0.x ] jobs: build: @@ -27,7 +27,7 @@ jobs: steps: - name: checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: set env variables uses: ./.github/workflows/composites/env-variables @@ -37,10 +37,6 @@ jobs: uses: ./.github/workflows/composites/setup-jdk17 if: env.BASE_BRANCH == 'main' || env.BASE_BRANCH == '3.0.x' - - name: setup project jdk-8 - uses: ./.github/workflows/composites/setup-jdk1.8 - if: env.BASE_BRANCH == '2.1.x' - - name: cache local maven repository uses: ./.github/workflows/composites/cache @@ -61,8 +57,7 @@ jobs: - name: restore test times cache if it exists id: restore_test_times_cache - if: env.BASE_BRANCH != '2.1.x' - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: /tmp/sorted.txt key: ${{ runner.os }}-spring-cloud-k8s-existing-test-times-cache-${{ github.run_id }} @@ -110,7 +105,7 @@ jobs: steps: - name: checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: clean space uses: ./.github/workflows/composites/clean-space @@ -122,10 +117,6 @@ jobs: uses: ./.github/workflows/composites/setup-jdk17 if: env.BASE_BRANCH == 'main' || env.BASE_BRANCH == '3.0.x' - - name: setup project jdk-8 - uses: ./.github/workflows/composites/setup-jdk1.8 - if: env.BASE_BRANCH == '2.1.x' - - name: pre-test-actions uses: ./.github/workflows/composites/pre-test-actions @@ -158,7 +149,7 @@ jobs: steps: - name: checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: clean space uses: ./.github/workflows/composites/clean-space @@ -170,10 +161,6 @@ jobs: uses: ./.github/workflows/composites/setup-jdk17 if: env.BASE_BRANCH == 'main' || env.BASE_BRANCH == '3.0.x' - - name: setup project jdk-8 - uses: ./.github/workflows/composites/setup-jdk1.8 - if: env.BASE_BRANCH == '2.1.x' - - name: pre-test-actions uses: ./.github/workflows/composites/pre-test-actions @@ -190,7 +177,6 @@ jobs: - name: run and save individual test times env: CURRENT_INDEX: ${{ matrix.current_index }} - if: env.BASE_BRANCH != '2.1.x' uses: ./.github/workflows/composites/run-and-save-test-times-when-cache-missing save_test_times_when_cache_missing: @@ -200,10 +186,9 @@ jobs: steps: - name: checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: compute and save running time of tests - if: env.BASE_BRANCH != '2.1.x' uses: ./.github/workflows/composites/test-times save_test_times_when_cache_present: @@ -213,8 +198,7 @@ jobs: steps: - name: checkout project - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: compute and save running time of tests - if: env.BASE_BRANCH != '2.1.x' uses: ./.github/workflows/composites/test-times