forked from moov-io/ach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
90 lines (80 loc) · 3.91 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
87
88
89
90
language: go
sudo: true
services:
- docker
matrix:
allow_failures:
- os: windows
- go: master
include:
# Linux
- os: linux
go: 1.13.x
cache:
directories: ["$HOME/.cache/go-build", "$GOPATH/pkg/mod"]
- os: linux
go: master
# macOS
- os: osx
go: 1.13.x
cache:
directories: ["$HOME/Library/Caches/go-build", "$GOPATH/pkg/mod"]
# Windows
- os: windows
go: 1.13.x
cache:
directories: ["C:\\Users\\travis\\AppData\\Local\\go-build"]
env:
matrix:
- GO111MODULE=on
before_install:
# 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
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then tar xf misspell.tar.gz && cp ./misspell ./bin/misspell; fi
# 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
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then tar xf staticcheck.tar.gz && cp ./staticcheck/staticcheck ./bin/staticcheck; fi
# golint
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then go get -u golang.org/x/lint/golint; fi
# 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
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then chmod +x ./bin/gocyclo; fi
# mingw (gnu libraries)
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install -y mingw; export PATH=/c/tools/mingw64/bin:"$PATH";fi
before_script:
- GOFILES=$(find . -type f -name '*.go' | grep -v vendor)
- go mod graph
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
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then misspell -error -locale US $GOFILES; fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then gocyclo -over 26 $GOFILES; fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then golint -set_exit_status $GOFILES; fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then staticcheck ./...; fi
after_success:
- bash <(curl -s https://codecov.io/bash)
- make docker
before_deploy:
- make dist
deploy:
provider: releases
api_key:
secure: S/CFrglarZ42a3crv+GgWSPZrPjIJglk1exzjbcP5KoPVinuucRxfQW/+92pfOSGTK2XZA1N20ZZE7+ba7HlWXkJDiICew8hCKHkDMW1Rj+E89zwzJMURXxDPTUkecE3h7BwSv72+XqQiezBo2HW5cPecQo3bmuhlmJO0ja9ntzhSpXTr1lcpBDIWvxHGzLR/Dcoceki3PI/nbv4i9ZVoUFtx9f/bbCQ7S/7qX6Dn5WKSjoEIvMgwtuAptYbEeDZ51mmudAuMAduNQpXJKiUUeryokP3sEP6FcwP7oKy6b7Dk92l1Q7MJ7lLj0xRcWIty5YCx1jKy5L/EKPLFinYdCJVyI1e11sF2YLvlzC3tsbOJHDgA2W4brt3hBfTW23FXgVJBAfKsCmwzcMrtR3WC0ukcwdTBva/oCIZUBkw0M2d4rDBgWLQ6vKtuCrn2WOlDTEVSyfzSxOSBdcLCgTeDELwdCW8nniuW9ldVUYotwDy/v9RljzOsb+dUwBtbagtXeQ2nraPWJnj8zHAkMQS11/FxxOQ53W5BQQGAEbeUIbwi5P4EJCHip70IqVKPkkWtPo3iVUyR7C4m0TkgA3L47PV/t8o4alvdHbhyP+DKYalQkdLiZSlFTMjavmXVO4ofhTHNAfz2LkemF8gcBiXQxpsBrUc5j+gi+nG3mfAgrE=
file_glob: true
file:
- bin/ach-*
on:
tags: true
repo: moov-io/ach
go: 1.13.x
skip_cleanup: true
after_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- make release-push