diff --git a/.travis.yml b/.travis.yml index 850444662..20e20efbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ language: go go: - 1.14 go_import_path: github.com/harmony-one/harmony +cache: + directories: + - docker_images env: - TEST="make" - TEST="bash ./scripts/travis_go_checker.sh" diff --git a/scripts/travis_rosetta_checker.sh b/scripts/travis_rosetta_checker.sh index 9d56835b4..150ed954f 100644 --- a/scripts/travis_rosetta_checker.sh +++ b/scripts/travis_rosetta_checker.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +CACHE_DIR="docker_images" +mkdir -p $CACHE_DIR +echo "pulling cached docker img" +docker load -i $CACHE_DIR/images.tar || true docker pull harmonyone/localnet-test +echo "saving cached docker img" +docker save -o $CACHE_DIR/images.tar harmonyone/localnet-test docker run -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -r \ No newline at end of file diff --git a/scripts/travis_rpc_checker.sh b/scripts/travis_rpc_checker.sh index 85534a343..6f0529bdb 100755 --- a/scripts/travis_rpc_checker.sh +++ b/scripts/travis_rpc_checker.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +CACHE_DIR="docker_images" +mkdir -p $CACHE_DIR +echo "pulling cached docker img" +docker load -i $CACHE_DIR/images.tar || true docker pull harmonyone/localnet-test +echo "saving cached docker img" +docker save -o $CACHE_DIR/images.tar harmonyone/localnet-test docker run -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -n \ No newline at end of file