diff --git a/.travis.yml b/.travis.yml index d505f8c8ebc..5b54277f75c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,26 @@ language: go go: - 1.11.x +env: + - DEP_VERSION="0.5.0" + +# Anything in before_script that returns a nonzero exit code will flunk the +# build and immediately stop. It's sorta like having set -e enabled in bash. +# Make sure golangci-lint is vendored. before_install: - - go get -t -v ./... - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.2 - - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + # Download the binary to bin folder in $GOPATH + - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep + # Make the binary executable + - chmod +x $GOPATH/bin/dep -script: - - cd $GOPATH/src/github.com/arduino/arduino-cli +install: # Check the dependency, -skip-lock may be useful because the version are not fixed but depends # from the branch master of the libraries so they change very often - dep check -skip-vendor - dep ensure + +script: # Check if the code is formatted - $(exit $(go fmt ./... | wc -l)) # Run linter @@ -24,3 +33,7 @@ script: after_success: - bash <(curl -s https://codecov.io/bash) + +cache: + directories: + - $GOPATH/pkg/dep \ No newline at end of file