Skip to content

Commit 6f36743

Browse files
committed
refactor: update integration_test.template.sh
1 parent a98cb8a commit 6f36743

File tree

3 files changed

+24
-109
lines changed

3 files changed

+24
-109
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<p align="center">
44
<a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/github/license/foldright/bash-buddy?color=4D7A97&logo=apache" alt="License"></a>
55
<a href="https://github.com/foldright/bash-buddy/releases"><img src="https://img.shields.io/github/release/foldright/bash-buddy.svg" alt="GitHub release"></a>
6-
<a href="https://github.com/foldright/bash-buddy/stargazers"><img src="https://img.shields.io/github/stars/foldright/bash-buddy" alt="GitHub Stars"></a>
7-
<a href="https://github.com/foldright/bash-buddy/fork"><img src="https://img.shields.io/github/forks/foldright/bash-buddy" alt="GitHub Forks"></a>
6+
<a href="https://github.com/foldright/bash-buddy/stargazers"><img src="https://img.shields.io/github/stars/foldright/bash-buddy?style=flat" alt="GitHub Stars"></a>
7+
<a href="https://github.com/foldright/bash-buddy/fork"><img src="https://img.shields.io/github/forks/foldright/bash-buddy?style=flat" alt="GitHub Forks"></a>
88
<a href="https://github.com/foldright/bash-buddy/issues"><img src="https://img.shields.io/github/issues/foldright/bash-buddy" alt="GitHub issues"></a>
99
<a href="https://github.com/foldright/bash-buddy"><img src="https://img.shields.io/github/repo-size/foldright/bash-buddy" alt="GitHub repo size"></a>
1010
</p>

templates/appveyor.template.yml

-87
This file was deleted.

templates/integration_test.template.sh

+22-20
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,56 @@ SELF_PATH=$(realpath -- "$0")
55
readonly SELF_PATH SELF_DIR=${SELF_PATH%/*}
66
cd "$SELF_DIR"
77

8-
FIXME BASH_BUDDY_ROOT="$(realpath -- path/to/bash-buddy/dir)"
8+
FIXME BASH_BUDDY_ROOT=......
99
readonly BASH_BUDDY_ROOT
10-
10+
# shellcheck disable=SC1091
1111
source "$BASH_BUDDY_ROOT/lib/trap_error_info.sh"
12+
# shellcheck disable=SC1091
1213
source "$BASH_BUDDY_ROOT/lib/common_utils.sh"
14+
# shellcheck disable=SC1091
15+
source "$BASH_BUDDY_ROOT/lib/java_utils.sh"
16+
# shellcheck disable=SC1091
17+
source "$BASH_BUDDY_ROOT/lib/maven_utils.sh"
1318

1419
################################################################################
1520
# prepare
1621
################################################################################
1722

18-
readonly default_build_jdk_version=11
19-
# shellcheck disable=SC2034
20-
readonly PREPARE_JDKS_INSTALL_BY_SDKMAN=(
23+
readonly default_build_jdk_version=17
24+
readonly JDK_VERSIONS=(
2125
8
26+
11
2227
"$default_build_jdk_version"
23-
17
28+
21
2429
)
2530

26-
source "$BASH_BUDDY_ROOT/lib/prepare_jdks.sh"
27-
28-
source "$BASH_BUDDY_ROOT/lib/maven_utils.sh"
29-
3031
################################################################################
3132
# ci build logic
3233
################################################################################
3334

34-
FIXME PROJECT_ROOT_DIR="$(realpath -- /path/to/project/root/dir)"
35-
cd "$PROJECT_ROOT_DIR"
35+
FIXME PROJECT_ROOT=......
36+
readonly PROJECT_ROOT
37+
cd "$PROJECT_ROOT"
3638

3739
########################################
3840
# do build and test by default version jdk
3941
########################################
4042

41-
prepare_jdks::switch_to_jdk "$default_build_jdk_version"
43+
jvu::switch_to_jdk "$default_build_jdk_version"
4244

43-
cu::head_line_echo "build and test with JDK: $JAVA_HOME"
44-
jvb::mvn_cmd clean install
45+
cu::head_line_echo "build and test with Java: $JAVA_HOME"
46+
mvu::mvn_cmd clean install
4547

4648
########################################
4749
# test by multi-version jdk
4850
########################################
49-
for jdk in "${PREPARE_JDKS_INSTALL_BY_SDKMAN[@]}"; do
51+
for jdk_version in "${JDK_VERSIONS[@]}"; do
5052
# already tested above
51-
[ "$jdk" = "$default_build_jdk_version" ] && continue
53+
[ "$jdk_version" = "$default_build_jdk_version" ] && continue
5254

53-
prepare_jdks::switch_to_jdk "$jdk"
55+
jvu::switch_to_jdk "$jdk_version"
5456

55-
cu::head_line_echo "test with JDK: $JAVA_HOME"
57+
cu::head_line_echo "test with Java: $JAVA_HOME"
5658
# just test without build
57-
jvb::mvn_cmd surefire:test
59+
mvu::mvn_cmd surefire:test
5860
done

0 commit comments

Comments
 (0)