Skip to content

Commit 113bf1f

Browse files
committed
chore(ci): use appveyor with bash-buddy instead of travis
1 parent 9402b32 commit 113bf1f

File tree

10 files changed

+153
-53
lines changed

10 files changed

+153
-53
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "scripts/bash-buddy"]
2+
path = scripts/bash-buddy
3+
url = https://github.com/foldright/bash-buddy.git

.mvn/wrapper/maven-wrapper.jar

49.5 KB
Binary file not shown.

.travis.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
📖 See the [📖 中文文档](README_CN.md) for the documents in Chinese.
66

7-
[![Build Status](https://img.shields.io/travis/alibaba/compileflow/master?logo=travis-ci&logoColor=white)](https://travis-ci.org/alibaba/compileflow)
7+
[![Build Status](https://img.shields.io/appveyor/ci/oldratlee/compileflow/master?logo=appveyor&logoColor=white)](https://ci.appveyor.com/project/oldratlee/compileflow)
88
[![Maven Central](https://img.shields.io/maven-central/v/com.alibaba.compileflow/compileflow?color=2d545e&logo=apache-maven&logoColor=white)](https://search.maven.org/artifact/com.alibaba.compileflow/compileflow)
99
[![GitHub release](https://img.shields.io/github/release/alibaba/compileflow.svg)](https://github.com/alibaba/compileflow/releases)
10-
[![JDK support](https://img.shields.io/badge/JDK-8+-green?logo=java&logoColor=white)](https://openjdk.java.net/)
10+
[![Java support](https://img.shields.io/badge/Java-8+-green?logo=java&logoColor=white)](https://openjdk.java.net/)
1111
[![License](https://img.shields.io/badge/license-Apache%202-4D7A97.svg?logo=Apache&logoColor=white)](https://www.apache.org/licenses/LICENSE-2.0.html)
1212
[![GitHub Stars](https://img.shields.io/github/stars/alibaba/compileflow)](https://github.com/alibaba/compileflow/stargazers)
1313
[![GitHub Forks](https://img.shields.io/github/forks/alibaba/compileflow)](https://github.com/alibaba/compileflow/fork)

README_CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
📖 查看 [📖 英文版文档](README.md).
66

7-
[![Build Status](https://img.shields.io/travis/alibaba/compileflow/master?logo=travis-ci&logoColor=white)](https://travis-ci.org/alibaba/compileflow)
7+
[![Build Status](https://img.shields.io/appveyor/ci/oldratlee/compileflow/master?logo=appveyor&logoColor=white)](https://ci.appveyor.com/project/oldratlee/compileflow)
88
[![Maven Central](https://img.shields.io/maven-central/v/com.alibaba.compileflow/compileflow?color=2d545e&logo=apache-maven&logoColor=white)](https://search.maven.org/artifact/com.alibaba.compileflow/compileflow)
99
[![GitHub release](https://img.shields.io/github/release/alibaba/compileflow.svg)](https://github.com/alibaba/compileflow/releases)
10-
[![JDK support](https://img.shields.io/badge/JDK-8+-green?logo=java&logoColor=white)](https://openjdk.java.net/)
10+
[![Java support](https://img.shields.io/badge/Java-8+-green?logo=java&logoColor=white)](https://openjdk.java.net/)
1111
[![License](https://img.shields.io/badge/license-Apache%202-4D7A97.svg?logo=Apache&logoColor=white)](https://www.apache.org/licenses/LICENSE-2.0.html)
1212
[![GitHub Stars](https://img.shields.io/github/stars/alibaba/compileflow)](https://github.com/alibaba/compileflow/stargazers)
1313
[![GitHub Forks](https://img.shields.io/github/forks/alibaba/compileflow)](https://github.com/alibaba/compileflow/fork)

appveyor.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# How to use AppVeyor to build a multi-arch Docker image for Linux and Windows
2+
# https://stefanscherer.github.io/use-appveyor-to-build-multi-arch-docker-image/
3+
#
4+
# Building ASP.NET Core apps on both Windows and Linux using AppVeyor
5+
# https://andrewlock.net/building-asp-net-core-apps-on-both-windows-and-linux-using-appveyor/
6+
#
7+
# appveyor.yml Example:
8+
# https://github.com/cdcseacave/openMVS/blob/master/.appveyor.yml
9+
10+
version: '{build}'
11+
image:
12+
- Ubuntu2004
13+
- Visual Studio 2017
14+
build: false
15+
clone_depth: 50
16+
branches:
17+
except:
18+
- gh-pages
19+
20+
environment:
21+
APPVEYOR_YML_DISABLE_PS_LINUX: true
22+
MAVEN_OPTS: "-Xmx768m -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2"
23+
JAVA_OPTS: "-Xmx768m"
24+
25+
for:
26+
-
27+
#------------------
28+
# Ubuntu
29+
#------------------
30+
matrix:
31+
only:
32+
- image: Ubuntu2004
33+
34+
test_script:
35+
- git submodule update --init
36+
- ./scripts/integration_test
37+
38+
after_test:
39+
# clear maven self install
40+
- rm -rf $HOME/.m2/repository/com/alibaba/compileflow
41+
- rm -rf $HOME/.sdkman/archives/*
42+
43+
cache:
44+
# if cache size is exceed appveyor limit:
45+
# Compressed cache item cannot exceed 1,048,576,000 bytes
46+
# skip below maven cache:
47+
- $HOME/.m2/
48+
- $HOME/.sdkman/
49+
-
50+
#------------------
51+
# Windows
52+
#------------------
53+
matrix:
54+
only:
55+
- image: Visual Studio 2017
56+
install:
57+
- ps: "ls 'C:/Program Files/Java/jdk*'"
58+
- ps: "ls 'C:/Program Files (x86)/Java/jdk*'"
59+
- echo JAVA_HOME=%JAVA_HOME%, HOMEPATH=%HOMEPATH%, PATH=%PATH%
60+
61+
test_script:
62+
# test under java 11
63+
- set JAVA_HOME=C:\Program Files\Java\jdk11
64+
- ./mvnw.cmd -V --no-transfer-progress clean install
65+
# test under java 8
66+
- set JAVA_HOME=C:\Program Files\Java\jdk1.8.0
67+
- ./mvnw.cmd -V --no-transfer-progress surefire:test
68+
69+
after_test:
70+
- ps: Remove-Item -r -fo $home\.m2\repository\com\alibaba\compileflow
71+
72+
cache:
73+
# https://www.appveyor.com/docs/build-cache/
74+
- '%HOMEDRIVE%%HOMEPATH%\.m2\'

scripts/bash-buddy

Submodule bash-buddy added at bb6ef88
File renamed without changes.

scripts/integration_test

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
set -eEuo pipefail
3+
cd "$(dirname "$(readlink -f "$0")")"
4+
5+
source bash-buddy/lib/trap_error_info.sh
6+
source bash-buddy/lib/common_utils.sh
7+
8+
################################################################################
9+
# prepare
10+
################################################################################
11+
12+
# shellcheck disable=SC2034
13+
PREPARE_JDKS_INSTALL_BY_SDKMAN=(
14+
8.322.06.2-amzn
15+
11.0.14-ms
16+
17.0.2.8.1-amzn
17+
)
18+
19+
source bash-buddy/lib/prepare_jdks.sh
20+
21+
source bash-buddy/lib/java_build_utils.sh
22+
23+
# here use `install` and `-D performRelease` intended
24+
# to check release operations.
25+
#
26+
# De-activate a maven profile from command line
27+
# https://stackoverflow.com/questions/25201430
28+
#
29+
# shellcheck disable=SC2034
30+
JVB_MVN_OPTS=(
31+
"${JVB_DEFAULT_MVN_OPTS[@]}"
32+
-DperformRelease
33+
-P'!gen-sign'
34+
# FIXME com.github.spotbugs:spotbugs-maven-plugin:check failed
35+
-P'!lint'
36+
)
37+
38+
################################################################################
39+
# ci build logic
40+
################################################################################
41+
42+
cd ..
43+
44+
########################################
45+
# default jdk 11, do build and test
46+
########################################
47+
48+
export CI_TEST_MODE=true
49+
export DCM_AGENT_SUPRESS_EXCEPTION_STACK=true
50+
51+
default_build_jdk_version=11
52+
53+
prepare_jdks::switch_java_home_to_jdk "$default_build_jdk_version"
54+
55+
cu::head_line_echo "build and test with Java: $JAVA_HOME"
56+
jvb::mvn_cmd clean install
57+
58+
########################################
59+
# test multi-version java
60+
# shellcheck disable=SC2154
61+
########################################
62+
for jhome_var_name in "${JDK_HOME_VAR_NAMES[@]}"; do
63+
# already tested by above `mvn install`
64+
[ "JDK${default_build_jdk_version}_HOME" = "$jhome_var_name" ] && continue
65+
66+
prepare_jdks::switch_java_home_to_jdk "${!jhome_var_name}"
67+
68+
cu::head_line_echo "test with Java: $JAVA_HOME"
69+
# just test without build
70+
jvb::mvn_cmd surefire:test
71+
done
File renamed without changes.

0 commit comments

Comments
 (0)