before_install: # Install various build dependencies. We use `travis_retry` because `go get` # will occasionally fail intermittently. # The testify require framework is used for assertions in the test suite - travis_retry go get -u github.com/stretchr/testify/require # Install lint / code coverage / coveralls tooling - travis_retry go get -u golang.org/x/net/http2 - travis_retry go get -u golang.org/x/tools/cmd/cover - travis_retry go get -u github.com/modocache/gover - travis_retry go get -u github.com/mattn/goveralls - travis_retry go get -u golang.org/x/lint/golint # Unpack and start the Stripe API stub so that the test suite can talk to it - | if [ ! -d "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}" ]; then mkdir -p stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}/ curl -L "https://github.com/stripe/stripe-mock/releases/download/v${STRIPE_MOCK_VERSION}/stripe-mock_${STRIPE_MOCK_VERSION}_linux_amd64.tar.gz" -o "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}_linux_amd64.tar.gz" tar -zxf "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}_linux_amd64.tar.gz" -C "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}/" fi - | stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}/stripe-mock -https-port 12112 -strict-version-check > /dev/null & STRIPE_MOCK_PID=$! # stripe-mock must be in PATH for `scripts/test_with_stripe_mock.go` to work. - export PATH="${PATH}:${PWD}/stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}" cache: directories: - stripe-mock env: global: # If changing this number, please also change it in `testing/testing.go`. - STRIPE_MOCK_VERSION=0.83.0 go: - "1.9.x" - "1.10.x" - "1.11.x" - "1.12.x" - tip language: go matrix: allow_failures: - go: tip fast_finish: true script: - make - make coverage after_script: # Merge all coverage reports located in subdirectories and put them under: gover.coverprofile - gover # Send code coverage report to coveralls.io - goveralls -service=travis-ci -coverprofile=gover.coverprofile sudo: false