forked from google/go-flow-levee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
47 lines (44 loc) · 1.13 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
language: golang
go:
- "1.14"
before_script:
- go install golang.org/x/tools/cmd/goimports
- sudo apt-get -y install yamllint
script:
- go test -v ./...
- >
echo "Checking goimports..." && (
if [[ -n $(goimports -l cmd internal pkg) ]]; then
goimports -d cmd internal pkg
echo 'Please run `goimports -w cmd internal pkg`.'
false
fi
)
- >
echo "Checking go mod..." && (
go mod tidy
git diff --quiet || (
git diff go.mod go.sum
echo 'Please run `go mod tidy`.'
false
)
)
- >
echo "Checking for license headers..." && (
FILES=$(grep -rL 'https://www.apache.org/licenses/LICENSE-2.0' cmd internal pkg | grep -vE "(.ssa|.dot)")
if [[ -n ${FILES} ]]; then
echo "The following files are missing the Apache header:"
echo ${FILES}
false
fi
)
- go install honnef.co/go/tools/cmd/staticcheck
- >
echo "Checking staticcheck..." && (
if [[ -n $(staticcheck ./... 2>&1) ]]; then
staticcheck ./...
echo 'Please run `staticcheck` and fix the issues.'
false
fi
)
- echo "Checking yaml..." && find . -name '*.yaml' -exec yamllint {} + &>/dev/null