From 80e869701c38245699921e29151c28dd1494d780 Mon Sep 17 00:00:00 2001 From: Mattia Bertorello Date: Tue, 8 Jan 2019 14:59:55 +0100 Subject: [PATCH] Refactoring the installation of dep https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-use-dep-in-ci --- .travis.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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