-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (40 loc) · 1.71 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
sudo: required
go_import_path: github.com/ory-am/hydra
services:
- docker
env:
- DOCKER_BIND_LOCALHOST=true GO15VENDOREXPERIMENT=1
language: go
go:
- 1.7
go_import_path: github.com/ory-am/hydra
install:
- go get github.com/mattn/goveralls golang.org/x/tools/cmd/cover github.com/Masterminds/glide github.com/mitchellh/gox
- git clone https://github.com/docker-library/official-images.git ~/official-images
- glide install
- go install github.com/ory-am/hydra
- glide update
- go install github.com/ory-am/hydra
script:
- |-
touch ./coverage.tmp && echo 'mode: atomic' > coverage.txt && go list ./... | grep -v /vendor | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverprofile=coverage.tmp -coverpkg $(go list ./... | grep -v /vendor | tr "\n" ",") {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp
- goveralls -coverprofile="coverage.txt"
- go test -race $(go list ./... | grep -v /vendor | grep -v /cmd)
- go test -v -bench=.* -run=none $(glide novendor)
- docker build -t hydra-travis-ci .
- docker run -d hydra-travis-ci
- $GOPATH/bin/hydra host --dangerous-auto-logon &
- while ! echo exit | nc localhost 4444; do sleep 1; done
- $GOPATH/bin/hydra token client --skip-tls-verify
after_success:
- |-
[ "${TRAVIS_TAG}" != "" ] && [ "${TRAVIS_GO_VERSION}" == "1.7" ] && gox -ldflags "-X github.com/ory-am/hydra/cmd.Version=`git describe --tags` -X github.com/ory-am/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory-am/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
deploy:
provider: releases
file_glob: true
api_key: "$GITHUB_TOKEN"
file: "dist/*"
skip_cleanup: true
on:
tags: true
go: 1.7