-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
52 lines (45 loc) · 1.5 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
language: go
env:
global:
- GO111MODULE=on DOCKER_USERNAME=summercashbot
services:
- docker
notifications:
email: false
install:
- export GO111MODULE=on
- go get -u
install: true
jobs:
include:
- stage: validate
name: "lint"
script:
- chmod +x ./scripts/validate_lint.sh # Make validate lint executable
- ./scripts/validate_lint.sh # Validate lint
- name: "vet"
script:
- go vet ./... # Run static analyzer
- name: "gofmt"
script:
- cd $(mktemp -d); go mod init tmp; go get mvdan.cc/gofumpt; cd $TRAVIS_BUILD_DIR
- git diff --quiet || (echo "\033[0;31mWorking directory not clean!\033[0m" && exit 1) # Check working dir clean
- gofumpt -w -s . # Fmt
- git diff --exit-code || (git checkout . && exit 1) # Ensure no changes made in working dir
- name: "tidy"
script:
- git diff --quiet || (echo "\033[0;31mWorking directory not clean!\033[0m" && exit 1) # Check working dir clean
- go mod tidy # Tidy
- git diff --exit-code || (git checkout . && exit 1) # Exit if not tidied
- stage: test
name: "test"
script:
- go run main.go & # Start node
- chmod +x ./test.sh && ./test.sh # Run unit tests
- stage: deploy
name: "push to dockerHub"
script:
- chmod +x scripts/push_docker.sh # Make executable
- ./scripts/push_docker.sh $DOCKER_USERNAME $DOCKER_PASSWORD # Push
after_success:
- bash <(curl -s https://codecov.io/bash)