Skip to content

Commit 6b2652c

Browse files
committed
build(CI): do not install java versions included in ubuntu image to speed up CI 🤖
1 parent 5571dbc commit 6b2652c

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

.github/workflows/strong_ci.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ jobs:
2020
with:
2121
# https://github.com/actions/setup-java?tab=readme-ov-file#install-multiple-jdks
2222
#
23-
# do NOT move old version 8.0.345 before 8, because the old version satisfied version 8
23+
# image(ubuntu-latest/ubuntu-24.04) included Java 8/11/17/21/25
24+
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java
2425
java-version: |
25-
8
2626
8.0.345
27-
11
28-
17
29-
21
3027
23
3128
distribution: zulu
3229
cache: maven

scripts/integration_test

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,12 @@ _findJdk8_0_345() {
2929
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
3030
if [ true = "${GITHUB_ACTIONS:-}" ]; then
3131
JAVA8_0_345_HOME="$(
32-
d="$(echo "$JAVA8_HOME/../.."/8.0.345*/x64)" || cu::die "Fail to get java home of v8.0.345!"
32+
d="$(echo /opt/hostedtoolcache/*/8.0.345*/x64)" || cu::die "Fail to get java home of v8.0.345!"
3333
cd "$d" || cu::die "Fail to cd java home of v8.0.345($d)!"
3434
pwd
3535
)"
3636

37-
JDK_8_LATEST="$(
38-
# shellcheck disable=SC2012
39-
d="$(ls -v -d "$JAVA8_HOME/../.."/8.* | tail -n 1)" || cu::die "Fail to get latest java 8 home!"
40-
cd "$d" || cu::die "Fail to cd java8 home"
41-
pwd
42-
)/x64"
43-
37+
JDK_8_LATEST="$(echo /usr/lib/jvm/*-8-jdk-*)"
4438
[ "$JDK_8_LATEST" != "$JAVA8_0_345_HOME" ] || cu::die "JDK_8_LATEST($JDK_8_LATEST) is same as JAVA8_0_345_HOME($JAVA8_0_345_HOME), NOT newer java 8 version!"
4539
export JAVA8_HOME="$JDK_8_LATEST"
4640
else

0 commit comments

Comments
 (0)