From 46c2a27c7c62feb64f8e01f7b978889823485733 Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Fri, 12 Jul 2019 11:27:30 +0300 Subject: [PATCH] Travis: cache local opam switch Also upgrade opam to 2.0.5. --- .travis.yml | 1 + test/ci/install-deps.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2c12624d34..70c1e993d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ cache: - $HOME/travis/.opam - $HOME/travis/.esy - $HOME/travis/.nvm + - ./_opam - ./_build/default install: diff --git a/test/ci/install-deps.sh b/test/ci/install-deps.sh index 8ac11d53b2..91ff97f2a6 100755 --- a/test/ci/install-deps.sh +++ b/test/ci/install-deps.sh @@ -22,7 +22,7 @@ if [[ $ESY_BUILD == YES ]]; then npm --global install esy@0.5.x else OPAM_RELEASES=https://github.com/ocaml/opam/releases/ - OPAM_VERSION=2.0.3 + OPAM_VERSION=2.0.5 case $TRAVIS_OS_NAME in "linux") OPAM_OS=linux;; @@ -37,5 +37,10 @@ else sudo chmod a+x /usr/local/bin/opam opam init -y --bare --disable-sandboxing - opam switch create . $OCAML $REPOSITORIES --no-install + + if [ ! -d _opam/bin ] + then + rm -rf _opam + opam switch create . $OCAML $REPOSITORIES --no-install + fi fi