Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
Use Travis Build Stages (#1331)
Browse files Browse the repository at this point in the history
* Build stages

* Skip installing go dependencies for docker testa
  • Loading branch information
gdbelvin committed Aug 5, 2019
1 parent 55b2c8e commit e593c9e
Showing 1 changed file with 23 additions and 29 deletions.
52 changes: 23 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@ env:
- GO111MODULE=on
- GOPROXY=https://proxy.golang.org

jobs:
include:
- name: "build"
script: go build ./...
- name: "lint"
install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
script: golangci-lint run --deadline=5m
- name: "coverage"
script:
- go test ./... -coverprofile=coverage1.txt
- go test ./impl/integration/ -coverprofile=coverage2.txt -coverpkg=./...
after_success: bash <(curl -s https://codecov.io/bash)
- name: "docker integration test"
install: skip
script: ./scripts/integration.sh
- stage: deploy
if: branch = master AND type != pull_request
install:
- gcloud -q components install kubectl
- openssl aes-256-cbc -K $encrypted_555d9b2948d2_key -iv $encrypted_555d9b2948d2_iv
-in client_secrets.json.enc -d | gcloud auth activate-service-account --key-file /dev/stdin
script: ./scripts/deploy.sh

before_install:
- |
if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then
Expand All @@ -32,34 +55,5 @@ before_install:
- gcloud -q components update
- gcloud -q version
- wget --version

install:
- gcloud -q components install kubectl
- docker --version
- docker-compose --version
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
- if [ "$GO111MODULE" = "auto" ]; then go get -t -v ./... ; fi

script:
- go build ./...
- golangci-lint run --deadline=5m
- go test ./... -coverprofile=coverage1.txt
- go test ./impl/integration/ -coverprofile=coverage2.txt -coverpkg=./...
- ./scripts/integration.sh

after_success:
- bash <(curl -s https://codecov.io/bash)

before_deploy:
- openssl aes-256-cbc -K $encrypted_555d9b2948d2_key -iv $encrypted_555d9b2948d2_iv
-in client_secrets.json.enc -d | gcloud auth activate-service-account --key-file /dev/stdin
- go get github.com/google/trillian/server/trillian_log_server
- go get github.com/google/trillian/server/trillian_log_signer
- go get github.com/google/trillian/server/trillian_map_server

deploy:
skip_cleanup: true
provider: script
script: ./scripts/deploy.sh
on:
branch: master

0 comments on commit e593c9e

Please sign in to comment.