Skip to content

Commit

Permalink
Travis: attempt to speed up esy and MacOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Jul 12, 2019
1 parent 46c2a27 commit 4e328c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ matrix:

cache:
directories:
- /usr/local/Cellar/opam
- /usr/local/Cellar/tidy-html5
- $HOME/travis/.opam
- $HOME/travis/.esy
- $HOME/travis/.nvm
- ./_opam
- ./_build/default
- $HOME/.opam
- $HOME/.esy
- $HOME/.nvm
- ./_opam
- ./_build/default

install:
- ./test/ci/install-deps.sh
Expand Down
15 changes: 5 additions & 10 deletions test/ci/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ set -e

# Install Tidy everywhere
case $TRAVIS_OS_NAME in
"linux")
sudo add-apt-repository -y ppa:robert7/tidy-html5
sudo apt-get update
sudo apt-get install tidy
;;

"osx")
brew install tidy-html5
brew link tidy-html5
;;
"linux")
sudo add-apt-repository -y ppa:robert7/tidy-html5
sudo apt-get update
sudo apt-get install tidy
;;
esac

# Install esy or opam
Expand Down
8 changes: 4 additions & 4 deletions test/html/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ module Env = struct
| `cases when from_root -> "test/html/cases"
| `cases -> "cases"

let running_in_travis =
match Sys.getenv "TRAVIS" with
| "true" -> true
let running_in_travis_on_linux =
match Sys.getenv "TRAVIS_OS_NAME" with
| "linux" -> true
| _ -> false
| exception Not_found -> false

let init () = begin
if running_in_travis && not Tidy.is_present_in_path then begin
if running_in_travis_on_linux && not Tidy.is_present_in_path then begin
Alcotest.failf "Could not find `tidy` in $PATH in a CI environment"
end;

Expand Down

0 comments on commit 4e328c5

Please sign in to comment.