forked from moov-io/ach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
96 lines (86 loc) · 5.16 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
91
92
93
94
95
96
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"]
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
# nancy (vulnerable dependencies)
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl -L -o ./bin/nancy https://github.com/sonatype-nexus-community/nancy/releases/download/v0.0.40/nancy-linux.amd64-v0.0.40; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -L -o ./bin/nancy https://github.com/sonatype-nexus-community/nancy/releases/download/v0.0.40/nancy-darwin.amd64-v0.0.40; fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then chmod +x ./bin/nancy; 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
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then go list -m all | ./bin/nancy; fi
after_success:
- bash <(curl -s https://codecov.io/bash)
- make docker
- make test-integration && make clean-integration
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
notifications:
slack:
secure: CbBIBY8jTuRNyBSv2JvsKzYeTdS1HBpwqqOTPeljHE2QL9u0h+Ji0yR+n1w3QqbzKurRjcKKs6mLgqy7Gmj40FXOxhro1icFMN9dapbwUanxwOzIicTVz1DqwlkB5KLMpVY6LYU4zAOusA7zpRkfORV18LiHYwS3332qtpnJU7I8rPh4JKxAR1oEwpl0KBjQQ0S5Nuo8xDcADjlAA2I6nw3Jz48Pynq5tEnNr99iXNmbOrIgHbVRaquZ+8t7N2V0mI5+9X1GRWnx8Z7hkcECvSMmDw7uZH3HF4yMp+XolAT2CRuz1H19LDZK1FPHCxc8FW9ApJcIrJaDal0/5W4H0jJ3Nhr2U2A0N90uaaDchizjOkYLkcYXtBSREqY6wOcXVWiMsTU8eEDDveAh/t0yKJSnQRcg3ePY924HsHI2H0yzxDu1LSaWH85dV/qIfV6oyvYYFdDrhzDJqWrwdwEu1Yqnc/nKsXV84uxyWDLJ36iyHG3yPb1qv6jPodteG/G2iS78lQicgZkPSgc8z1DHuHFAbagHiBbze5UrHTP6OJpAjyUWGJSe0hcrbBqRl+f410OuvpIEJr8U63luGMkrV6GuODPTLfLOWCfA1E1/RDA3NitTq1Ep5pmzOSta9Bmpm2fbl58Sp46Z9Nta/Sq8UMufxcq1ayJtwg6nd9F1iRE=