-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy path.travis.yml
32 lines (25 loc) · 1.01 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
# sudo is required for docker
sudo: required
language: go
go:
- "1.22.x"
env:
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
services:
- docker
install:
- docker pull mysql:8.0
- go install github.com/kisielk/errcheck@latest
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
# With the "docker" tag enabled on go test invocation (-tags docker)
# the mysql:5.6 docker container will be started
# and the mysql tests will connect to this container
# This requires us to stop the pre-installed mysql server
script:
- sudo service mysql stop
- diff -u <(echo -n) <(gofmt -d `find . -name '*.go' | grep -Ev '/vendor/|/migration'`)
- go vet `go list ./... | grep -v /vendor/`
- errcheck -ignore 'io:Close' -ignoretests `go list ./... | grep -v /vendor/`
- make clean test build lint
after_success:
- ./update-docs.sh