diff --git a/.travis.yml b/.travis.yml index 130d91151f1..3b0281bff39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,30 @@ language: go -sudo: required - -go: - - 1.5 - - 1.6 - - 1.7 - - 1.8 - - 1.9 - - tip - -# Use Go 1.5's vendoring experiment for 1.5 tests. -env: - - GO15VENDOREXPERIMENT=1 - -install: - - make get-deps +matrix: + allow_failures: + - go: tip + include: + - os: linux + sudo: required + - os: linux + sudo: required + go: 1.9.x + - os: linux + sudo: required + go: 1.10.x + - os: linux + sudo: required + go: tip + - os: osx + go: 1.9.x + - os: osx + go: 1.10.x + - os: osx + go: tip script: - - make unit-with-race-cover + - make ci-test -matrix: - allow_failures: - - go: tip +branches: + only: + - master diff --git a/Makefile b/Makefile index db2369e4cde..b3c6d95c75a 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ SDK_ONLY_PKGS=$(shell go list ./... | grep -v "/vendor/") SDK_UNIT_TEST_ONLY_PKGS=$(shell go list -tags ${UNIT_TEST_TAGS} ./... | grep -v "/vendor/") SDK_GO_1_4=$(shell go version | grep "go1.4") SDK_GO_1_5=$(shell go version | grep "go1.5") +SDK_GO_1_6=$(shell go version | grep "go1.6") SDK_GO_VERSION=$(shell go version | awk '''{print $$3}''' | tr -d '''\n''') SDK_V1_USAGE=$(shell go list -f '''{{ if not .Standard }}{{ range $$_, $$name := .Imports }} * {{ $$.ImportPath }} -> {{ $$name }}{{ print "\n" }}{{ end }}{{ end }}''' ./... | sort -u | grep '''/aws-sdk-go/''') @@ -69,6 +70,18 @@ unit-with-race-cover: get-deps-tests build verify @echo "go test SDK and vendor packages" @go test -tags ${UNIT_TEST_TAGS} -race -cpu=1,2,4 $(SDK_UNIT_TEST_ONLY_PKGS) +ci-test: ci-test-generate unit-with-race-cover ci-test-generate-validate + +ci-test-generate: get-deps + @echo "CI test generated code" + @if [ \( -z "${SDK_GO_1_6}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then make generate; else echo "skipping generate"; fi + +ci-test-generate-validate: + @echo "CI test validate no generated code changes" + @gitstatus=`if [ \( -z "${SDK_GO_1_6}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then git status --porcelain; else echo "skipping validation"; fi`; \ + echo "$$gitstatus"; \ + if [ "$$gitstatus" != "" ] && [ "$$gitstatus" != "skipping validation" ]; then git diff; exit 1; fi + integration: get-deps-tests integ-custom smoke-tests performance integ-custom: diff --git a/buildspec.yml b/buildspec.yml index d0b43faf503..24302d538a1 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -12,7 +12,7 @@ phases: - cd $SDK_GO_ROOT - go get -u github.com/golang/dep/cmd/dep - dep ensure - - make unit + - make ci-test - cd $SDK_CB_ROOT post_build: commands: