diff --git a/.travis.yml b/.travis.yml index b8fdaf2fa..a257718f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,12 @@ matrix: sudo: required - os: linux dist: trusty - sudo: required + sudo: false env: RUN_UI_TESTS=1 SKIP_NOMAD_TESTS=1 + - os: linux + dist: trusty + sudo: false + env: RUN_STATIC_CHECKS=1 SKIP_NOMAD_TESTS=1 - os: osx osx_image: xcode9.1 @@ -34,11 +38,12 @@ cache: - ui/node_modules before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo -E bash ./scripts/travis-mac-priv.sh ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo -E bash ./scripts/travis-linux.sh ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -z "$SKIP_NOMAD_TESTS" ]]; then sudo -E bash ./scripts/travis-mac-priv.sh ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$SKIP_NOMAD_TESTS" ]]; then sudo -E bash ./scripts/travis-linux.sh ; fi install: - - make bootstrap + - if [[ -z "$SKIP_NOMAD_TESTS" ]]; then make deps ; fi + - if [[ "$RUN_STATIC_CHECKS" ]]; then make lint-deps ; fi script: - sudo -E "PATH=$PATH" make travis diff --git a/GNUmakefile b/GNUmakefile index fac142f8b..5afaabeeb 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -132,25 +132,24 @@ endef # Reify the package targets $(foreach t,$(ALL_TARGETS),$(eval $(call makePackageTarget,$(t)))) -# Only for Travis CI compliance .PHONY: bootstrap -bootstrap: deps +bootstrap: deps lint-deps # Install all dependencies .PHONY: deps -deps: ## Install build and development dependencies +deps: ## Install build and development dependencies @echo "==> Updating build dependencies..." - go get -u github.com/alecthomas/gometalinter - gometalinter --install go get -u github.com/kardianos/govendor - go get -u golang.org/x/tools/cmd/cover - go get -u github.com/axw/gocov/gocov - go get -u gopkg.in/matm/v1/gocov-html go get -u github.com/ugorji/go/codec/codecgen go get -u github.com/jteeuwen/go-bindata/... go get -u github.com/elazarl/go-bindata-assetfs/... - go get -u github.com/hashicorp/vault go get -u github.com/a8m/tree/cmd/tree +.PHONY: lint-deps +lint-deps: ## Install linter dependencies + @echo "==> Updating linter dependencies..." + go get -u github.com/alecthomas/gometalinter + gometalinter --install + .PHONY: check check: ## Lint the source code @echo "==> Linting source code..." diff --git a/scripts/travis.sh b/scripts/travis.sh index 037d21fc8..9d7a2ad96 100755 --- a/scripts/travis.sh +++ b/scripts/travis.sh @@ -7,8 +7,13 @@ PING_LOOP_PID=$! trap 'kill ${PING_LOOP_PID}' EXIT HUP INT QUIT TERM -make check -if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make checkscripts ; fi +if [[ "$RUN_STATIC_CHECKS" ]]; then + make check + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + make checkscripts + fi +fi + make test TEST_OUTPUT=$?