Skip to content

Commit

Permalink
Reuse cache for GraalVM and sbt (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiminhsieh authored and muuki88 committed Jun 12, 2019
1 parent 0258bcf commit b056d86
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ cache:
- $HOME/.sbt
- $HOME/.m2
- $HOME/.ivy2
- $HOME/.local/share/graalvm-ce-1.0.0-rc8
- $GRAALVM_PARENT_DIRECTORY

env:
global:
- GRAALVM_PARENT_DIRECTORY: ${HOME}/.local/share
- COMMIT_AUTHOR_EMAIL: "sbt-native-packager@muki.rocks"
- RELEASE_BRANCH: master
- secure: bK5zEd2s3y+ScGwuGcxlP0tXx83nvurmF/SWuQSmI0A2KRelipGSSY2BTa+URKk9smJusJIZUi72EqEwMHDhxLCfHomjze5BmpJB5Mr3fQI700nxPEA95cbM4Z1G9+K6fYWy2pi5S7Xmz1Sg07bP4sfzyVYlNB20aquLCmB9Llk=
Expand All @@ -37,7 +38,7 @@ before_install:

before_script:
- .travis/download-sbt
- . .travis/download-graalvm
- .travis/download-graalvm

# job definitions

Expand Down
3 changes: 2 additions & 1 deletion .travis/download-graalvm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function setup_os_specific_envs() {

setup_os_specific_envs
GRAALVM_VERSION=19.0.0
GRAALVM_PARENT_DIRECTORY=${HOME}/.local/share
GRAALVM_DISTRIBUTION=graalvm-ce
GRAAL_DIRECTORY=${GRAALVM_PARENT_DIRECTORY}/${GRAALVM_DISTRIBUTION}-${GRAALVM_VERSION}
TAR_GZ_FILENAME=${GRAALVM_DISTRIBUTION}-${OS_NAME}-amd64-${GRAALVM_VERSION}.tar.gz
Expand All @@ -34,6 +33,8 @@ then
tar zxf ${TAR_GZ_FILENAME} &&
${GRAAL_DIRECTORY}/${BIN_PATH}/gu install native-image &&
rm -f ${TAR_GZ_FILENAME})
else
echo "GraalVM Native Image already exists"
fi
ls -lsa ${NATIVE_IMAGE}
mkdir -p ${NATIVE_IMAGE_TARGET_DIRECTORY}
Expand Down
6 changes: 6 additions & 0 deletions .travis/download-sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
SBT_VERSION=1.2.6
SBT_LAUNCH_JAR_URL=http://dl.bintray.com/sbt/maven-releases/org/scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
TARGET_SBT_LAUNCH_JAR=${HOME}/.sbt/launchers/${SBT_VERSION}/sbt-launch.jar

if [ -f ${TARGET_SBT_LAUNCH_JAR} ]; then
echo "sbt ${SBT_VERSION} already exists"
exit
fi

curl -L --create-dirs -o ${TARGET_SBT_LAUNCH_JAR} ${SBT_LAUNCH_JAR_URL}

0 comments on commit b056d86

Please sign in to comment.