-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New GitHub Actions build process (#285)
* First test of GitHub actions integration * Changed actions checkout to specific version * New build script to install dependencies on local environment in a single run * Fixed issues with CI workflow for spring, springboot2 and struts * More minor fixes to build workflow. getting there * Renamed struts sample folder to match the naming used in the framework implementation * Minor fix for Spring 4.3 build * Added GitHub actions badge to readme
- Loading branch information
Showing
13 changed files
with
194 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Serverless Java Container Continuous Integration | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build_core: | ||
name: Build and test core | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build latest | ||
run: mvn -q clean install | ||
working-directory: ./aws-serverless-java-container-core | ||
|
||
build_jersey: | ||
name: Build and test Jersey | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build latest | ||
run: ./gha_build.sh jersey true true | ||
- name: Build Jersey 2.26 | ||
run: ./gha_build.sh jersey false false -Djersey.version=2.26 | ||
- name: Build Jersey 2.27 | ||
run: ./gha_build.sh jersey false false -Djersey.version=2.27 | ||
- name: Build Jersey 2.28 | ||
run: ./gha_build.sh jersey false false -Djersey.version=2.28 | ||
|
||
build_spark: | ||
name: Build and test Spark | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build latest | ||
run: ./gha_build.sh spark true true | ||
- name: Build Spark 2.8.0 | ||
run: ./gha_build.sh spark false false -Dspark.version=2.8.0 | ||
|
||
build_spring: | ||
name: Build and test Spring & SpringBoot | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build latest | ||
run: ./gha_build.sh spring true true | ||
- name: Build Spring 4.3 | ||
run: ./gha_build.sh spring false false -Dspring.version=4.3.25.RELEASE -Dspring-security.version=4.2.13.RELEASE | ||
- name: Build Spring 5.0 | ||
run: ./gha_build.sh spring false false -Dspring.version=5.0.15.RELEASE -Dspring-security.version=5.0.13.RELEASE | ||
|
||
build_springboot2: | ||
name: Build and test SpringBoot 2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build latest | ||
run: ./gha_build.sh springboot2 true true | ||
- name: Build Spring Boot 2.0 | ||
run: ./gha_build.sh springboot2 false false -Dspringboot.version=2.0.9.RELEASE -Dspring.version=5.0.13.RELEASE -Dspringsecurity.version=5.0.12.RELEASE | ||
|
||
build_struts2: | ||
name: Build and test Struts 2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build latest | ||
run: ./gha_build.sh struts2 true true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/usr/bin/env bash | ||
|
||
WORKING_DIR=$(pwd) | ||
FRAMEWORK=$1 | ||
RUN_ARCHETYPE=$2 | ||
RUN_SAMPLES=$3 | ||
EXTRA_PARAMS=${*:4} | ||
|
||
echo "Starting build script for ${FRAMEWORK} with params ${EXTRA_PARAMS}" | ||
|
||
if [[ -z ${FRAMEWORK} ]] ; then | ||
echo "Missing framework parameter" | ||
exit 1 | ||
fi | ||
|
||
function install { | ||
# we skip tests for core because we assume they will be run in a separate branch of the workflow | ||
cd ${WORKING_DIR}/aws-serverless-java-container-core && mvn -q clean install -DskipTests | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${WORKING_DIR}/aws-serverless-java-container-$1 && mvn -q clean install ${@:2} | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
} | ||
|
||
function archetype { | ||
ARCHETYPE_NAME=aws-serverless-$1-archetype | ||
PROJ_NAME=$1-archetype-test | ||
cd ${WORKING_DIR}/${ARCHETYPE_NAME} && mvn -q clean install | ||
ARCHETYPE_TEST_DIR=${WORKING_DIR}/$1_archetype_test | ||
mkdir -p ${ARCHETYPE_TEST_DIR} | ||
cd ${ARCHETYPE_TEST_DIR} && mvn archetype:generate -DgroupId=my.service -DartifactId=${PROJ_NAME} -Dversion=1.0-SNAPSHOT \ | ||
-DarchetypeGroupId=com.amazonaws.serverless.archetypes \ | ||
-DarchetypeArtifactId=${ARCHETYPE_NAME} \ | ||
-DarchetypeCatalog=local \ | ||
-DinteractiveMode=false | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${ARCHETYPE_TEST_DIR}/${PROJ_NAME} && mvn -q clean package -Pshaded-jar | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${ARCHETYPE_TEST_DIR}/${PROJ_NAME} && mvn -q clean package | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${ARCHETYPE_TEST_DIR}/${PROJ_NAME} && gradle -q wrapper | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${ARCHETYPE_TEST_DIR}/${PROJ_NAME} && ./gradlew wrapper --gradle-version 5.0 | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${ARCHETYPE_TEST_DIR}/${PROJ_NAME} && ./gradlew -q clean build | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
} | ||
|
||
function sample { | ||
# force to pet store for now. In the future we may loop over all samples | ||
SAMPLE_FOLDER=${WORKING_DIR}/samples/$1/pet-store | ||
cd ${SAMPLE_FOLDER} && mvn -q clean package | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${SAMPLE_FOLDER} && gradle -q wrapper | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${SAMPLE_FOLDER} && ./gradlew wrapper --gradle-version 5.0 | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
cd ${SAMPLE_FOLDER} && ./gradlew -q clean build | ||
if [[ "$?" -ne 0 ]]; then | ||
exit 1 | ||
fi | ||
|
||
SAM_FILE=${SAMPLE_FOLDER}/sam.yaml | ||
if [[ -f "$SAM_FILE" ]]; then | ||
TARGET_ZIP=$(cat ${SAM_FILE} | grep CodeUri | sed -e 's/^.*:\ //g') | ||
if [[ ! -f "${SAMPLE_FOLDER}/${TARGET_ZIP}" ]]; then | ||
echo "COULD NOT FIND TARGET ZIP FILE $TARGET_ZIP FOR $1 SAMPLE" | ||
exit 1 | ||
fi | ||
else | ||
echo "COULD NOT FIND SAM FILE: '${SAM_FILE}'" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# set up the master pom otherwise we won't be able to find new dependencies | ||
cd ${WORKING_DIR}/ && mvn -q --non-recursive clean install | ||
|
||
case $1 in | ||
# special case for spring since we include both spring and springboot 1.x in one package | ||
spring) | ||
install ${FRAMEWORK} ${EXTRA_PARAMS} | ||
if [[ "$RUN_ARCHETYPE" = true ]] ; then | ||
archetype ${FRAMEWORK} | ||
archetype springboot | ||
fi | ||
if [[ "$RUN_SAMPLES" = true ]] ; then | ||
sample ${FRAMEWORK} | ||
sample springboot | ||
fi | ||
break | ||
;; | ||
*) | ||
install ${FRAMEWORK} ${EXTRA_PARAMS} | ||
if [[ "$RUN_ARCHETYPE" = true ]] ; then | ||
archetype ${FRAMEWORK} | ||
fi | ||
if [[ "$RUN_SAMPLES" = true ]] ; then | ||
sample ${FRAMEWORK} | ||
fi | ||
;; | ||
esac |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.