-
Notifications
You must be signed in to change notification settings - Fork 7
/
.travis.yml
68 lines (57 loc) · 1.56 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
version: ~> 1.0
os: linux
dist: focal
language: go
go:
- 1.17.x
services:
- docker
addons:
apt:
packages:
# needed for the nfpm pipe:
- rpm
snaps:
- name: goreleaser
confinement: classic
- name: aws-cli
confinement: classic
env:
global:
- GO111MODULE=on
- CGO_ENABLED=0
- ARCH=x86_64
- AWS_REGION=us-east-1
- AWS_DEFAULT_REGION=us-east-1
before_install:
# https://github.com/codeclimate/test-reporter#installation--usage
# Download the binary to bin folder in $GOPATH
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $GOPATH/bin/cc-test-reporter
# Make the binary executable
- chmod +x $GOPATH/bin/cc-test-reporter
- mkdir tmp || true
install: true
cache:
directories:
- "$HOME/.local/bin"
- "$HOME/.local/lib/aws"
- "$HOME/gopath/pkg/mod"
before_script:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
- go mod download && go build
script:
# See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
- 'golangci-lint run'
- 'if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then bash go test ./...; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./scripts/coverage_test; fi'
after_script:
- goreleaser --snapshot --skip-publish --rm-dist
deploy:
- provider: script
# calls goreleaser
skip_cleanup: true
cleanup: false
script: scripts/deploy
on:
tags: true
condition: $TRAVIS_OS_NAME = linux