Skip to content

Commit

Permalink
chore(ci): update CI java versions; upgrade GitHub actions; upgrade b…
Browse files Browse the repository at this point in the history
…ash-buddy

Co-authored-by: Jerry Lee <[email protected]>
  • Loading branch information
zavakid and oldratlee committed Dec 6, 2023
1 parent 80a86df commit 1275b35
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 82 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ updates:
directory: "/auto-pipeline-examples"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022 ]
java: [ 8, 20 ]
java: [ 8, 21 ]
fail-fast: false
max-parallel: 32
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
name: CI on JDK ${{ matrix.java }} OS ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install mdbook
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/strong-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,41 @@ jobs:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
runs-on: ubuntu-latest
timeout-minutes: 15
name: test by multiply java versions
name: CI by multiply java versions

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: setup Java 8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
# only first java setup need enable cache
cache: maven
- name: setup Java 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 11
distribution: microsoft
- name: setup Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: microsoft
- name: setup Java 20
uses: actions/setup-java@v3
with:
java-version: 20
distribution: zulu
- name: setup Java 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 21-ea
java-version: 21
distribution: zulu

- run: scripts/integration_test
env:
JAVA8_HOME: ${{ env.JAVA_HOME_8_X64 }}
JAVA11_HOME: ${{ env.JAVA_HOME_11_X64 }}
JAVA17_HOME: ${{ env.JAVA_HOME_17_X64 }}
JAVA20_HOME: ${{ env.JAVA_HOME_20_X64 }}
JAVA21_HOME: ${{ env.JAVA_HOME_21_X64 }}

- name: remove self maven install files
Expand Down
36 changes: 0 additions & 36 deletions scripts/clear_appveyor_cache

This file was deleted.

46 changes: 19 additions & 27 deletions scripts/integration_test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ BASH_BUDDY_ROOT="$(readlink -f bash-buddy)"
readonly BASH_BUDDY_ROOT
source "$BASH_BUDDY_ROOT/lib/trap_error_info.sh"
source "$BASH_BUDDY_ROOT/lib/common_utils.sh"
source "$BASH_BUDDY_ROOT/lib/java_build_utils.sh"
source "$BASH_BUDDY_ROOT/lib/java_utils.sh"
source "$BASH_BUDDY_ROOT/lib/maven_utils.sh"

################################################################################
# ci build logic
Expand All @@ -18,10 +19,8 @@ readonly JDK_VERSIONS=(
8
$default_build_jdk_version
17
20
21
)
readonly default_jh_var_name="JAVA${default_build_jdk_version}_HOME"

# here use `install` and `-D performRelease` intended
# to check release operations.
Expand All @@ -30,8 +29,8 @@ readonly default_jh_var_name="JAVA${default_build_jdk_version}_HOME"
# https://stackoverflow.com/questions/25201430
#
# shellcheck disable=SC2034
readonly JVB_MVN_OPTS=(
"${JVB_DEFAULT_MVN_OPTS[@]}"
readonly MVU_MVN_OPTS=(
"${MVU_DEFAULT_MVN_OPTS[@]}"
-DperformRelease -P'!gen-sign'
${CI_MORE_MVN_OPTS:+${CI_MORE_MVN_OPTS}}
)
Expand All @@ -42,42 +41,35 @@ cd ..
# build and test by default version jdk
########################################

[ -d "${!default_jh_var_name:-}" ] || cu::die "\$${default_jh_var_name}(${!default_jh_var_name:-}) dir is not existed!"
export JAVA_HOME="${!default_jh_var_name}"
jvu::switch_to_jdk "$default_build_jdk_version"

cu::head_line_echo "build and test with Java $default_build_jdk_version: $JAVA_HOME"
jvb::mvn_cmd clean install
mvu::mvn_cmd clean install

########################################
# test by multiply version jdks
########################################

# about CI env var
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
if [ "${CI:-}" = true ]; then
readonly CI_MORE_BEGIN_OPTS=jacoco:prepare-agent CI_MORE_END_OPTS=jacoco:report
fi

for jdk_version in "${JDK_VERSIONS[@]}"; do
jh_var_name="JAVA${jdk_version}_HOME"
[ -d "${!jh_var_name:-}" ] || cu::die "\$${jh_var_name}(${!jh_var_name:-}) dir is not existed!"
export JAVA_HOME="${!jh_var_name}"
jvu::switch_to_jdk "$jdk_version"

# just test without build
cu::head_line_echo "test with Java $jdk_version: $JAVA_HOME"

# about CI env var
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
if [ "${CI:-}" = true ]; then
# skip default jdk, already tested above
[ "$jdk_version" = "$default_build_jdk_version" ] &&
jvb::mvn_cmd jacoco:prepare-agent surefire:test jacoco:report

# Test for slf4j v1
jvb::mvn_cmd jacoco:prepare-agent -P enable-slf4j-v1 dependency:tree surefire:test jacoco:report
else
# skip default jdk, already tested above
[ "$jdk_version" = "$default_build_jdk_version" ] &&
jvb::mvn_cmd surefire:test

# Test for slf4j v1
jvb::mvn_cmd -P enable-slf4j-v1 dependency:tree surefire:test
# skip default jdk, already tested above
if [ "$jdk_version" != "$default_build_jdk_version" ]; then
mvu::mvn_cmd ${CI_MORE_BEGIN_OPTS:-} surefire:test ${CI_MORE_END_OPTS:-}
fi

# Test for slf4j v1
mvu::mvn_cmd ${CI_MORE_BEGIN_OPTS:-} -P enable-slf4j-v1 dependency:tree surefire:test ${CI_MORE_END_OPTS:-}

(
cd auto-pipeline-examples
cu::log_then_run ./gradlew clean test
Expand Down

0 comments on commit 1275b35

Please sign in to comment.