forked from moov-io/watchman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
86 lines (86 loc) · 3.67 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
language: go
dist: xenial
sudo: true
services:
- docker
env:
matrix:
- GO111MODULE=on
matrix:
allow_failures:
- go: master
include:
- os: linux
go: 1.13.x
cache:
directories:
- "/home/travis/.cache/go-build"
- "webui/node_modules/"
- os: linux
go: master
- os: osx
go: 1.13.x
cache:
directories:
- "/Users/travis/Library/Caches/go-build"
- "webui/node_modules/"
# - os: windows
# go: 1.13.x
before_install:
# Setup node.js
- nvm install stable && nvm use stable
# Setup directory for binaries
- mkdir ./bin
- export PATH=$PATH:$PWD/bin
# Misspell
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -O misspell.tar.gz https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_linux_64bit.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O misspell.tar.gz https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_mac_64bit.tar.gz; fi
- tar xf misspell.tar.gz && cp ./misspell ./bin/misspell
# staticcheck
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -O staticcheck.tar.gz https://github.com/dominikh/go-tools/releases/download/2019.2.3/staticcheck_linux_amd64.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O staticcheck.tar.gz https://github.com/dominikh/go-tools/releases/download/2019.2.3/staticcheck_darwin_amd64.tar.gz; fi
- tar xf staticcheck.tar.gz && cp ./staticcheck/staticcheck ./bin/staticcheck
# golint
- go get -u golang.org/x/lint/golint
# gocyclo
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -O ./bin/gocyclo https://github.com/adamdecaf/gocyclo/releases/download/2019-08-09/gocyclo-linux-amd64; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O ./bin/gocyclo https://github.com/adamdecaf/gocyclo/releases/download/2019-08-09/gocyclo-darwin-amd64; fi
- chmod +x ./bin/gocyclo
before_script:
- GOFILES=$(find . -type f -name '*.go' | grep -v vendor | grep -v client)
- go mod tidy
- make
script:
# Just check gofmt on linux, it's the fastest builder
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test -z $(gofmt -s -l $GOFILES); fi
- go test ./... -race -coverprofile=coverage.txt -covermode=atomic
- misspell -error -locale US $GOFILES
- gocyclo -over 20 $GOFILES
- golint -set_exit_status $GOFILES
- staticcheck ./cmd/... ./internal/... .
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install -y mingw; export PATH=/c/tools/mingw64/bin:"$PATH";fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make docker && make test-integration; fi
after_script:
- docker-compose logs
- make clean-integration
after_success:
- bash <(curl -s https://codecov.io/bash) -X fix
- make client
- make docker
before_deploy:
- make dist
deploy:
provider: releases
api_key:
secure: lPJQJFPgzw0eAZwG6A5yG3hMVrkuAeXhZy0wcWpOHWH/Ten2uDPo0hm4W5aoeTLi0ABEL9YWeheZRtq5BY9sxNBZLoGf4duz9q4Nc+WvrJT7dIEaynbK1ou2ycHPU35VX3FY6wdcCBPxcDVNQiKHgreXpY6IbcBj8iDWYaaz945INoN+8LAkceyeonrm7AeqeS2jEmdbxlOAHxGFh2mgP2XylLAIKrWe/tvOEPvn7Hz/EIjTJE7K5+j+UhNFFUd+VtcN8I/qyPrs9IoleIKrU9lx1RcrXA0EPDt+bXFzc233Uwa5lYBsj3mtI1imriCEy9ByA8CEBwYOxa9KQPendkGlwqGrKn3bjDXKuBKM7nsiJWG4uHUABMQGBVDXGXcOJnDsmcaR69sCrNxFWed8R4YpYC/QLZkNVPnw4E08dQ9gaw83I6mUW01/qeFczgDd/HDjhNRB1o6/y4Jb5kPVTRYiQ8p+suAmhPfmIUOKlSjwBTB95LisrWtEud66tzfkV9XdKvuxh0FYdlIGDhexcUEME7ZkYo5gelDPmX4V5NagBmKd+9Y+xYAsqCE/Z3Vy0DWRyGZYZGxWcQ5+8M0XlYrPqBP6saDALM8XI+apNuLa3KKzozS5s4G2F9vSVyFHOS+uhOnAz6gftrL9t6g2E9KHiN43tf2JhNrsVNqZbEs=
file_glob: true
file:
- bin/ofac-*
on:
repo: moov-io/ofac
tags: true
go: 1.13.x
skip_cleanup: true
after_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- make release-push