Drop jdk8 build support + various improvements (#1638)

This commit is contained in:
erabii
2024-04-17 18:46:43 +03:00
committed by GitHub
parent 013b920bcf
commit d44edfc208
10 changed files with 31 additions and 95 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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'

View File

@@ -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'

View File

@@ -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 }}

View File

@@ -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