-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
43 lines (37 loc) · 1.11 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
language: go
env:
global:
- GO111MODULE=on
notifications:
email: false
before_install:
- chmod +x scripts/before_install.sh
- ./scripts/before_install.sh
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
- 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
- stage: test
name: "test"
script:
- go run main.go # Run main
- chmod +x ./scripts/test.sh && ./scripts/test.sh # Run unit tests