forked from fyne-io/fyne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
89 lines (81 loc) · 3.14 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
language: go
go_import_path: fyne.io/fyne
addons:
apt:
packages:
- libgl1-mesa-dev
- libegl1-mesa-dev
- libgles2-mesa-dev
- xorg-dev
gobuild_args: "-v -tags ci"
# Disable travis default install step (go get ${gobuild_args} ./...)
install: true
before_script:
- GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/)
- GO111MODULE=off go get golang.org/x/tools/cmd/goimports
- GO111MODULE=off go get github.com/fzipp/gocyclo
- GO111MODULE=off go get golang.org/x/lint/golint
- GO111MODULE=off go get github.com/mattn/goveralls
script:
- |
if [ "$GO111MODULE" == "on" ]
then
# For some reason `git diff-index HEAD` does not work properly if the following line is missing.
git diff
# check that go mod tidy does not change go.mod/go.sum
go mod tidy && git diff-index --quiet HEAD -- || ( echo "go.mod/go.sum not up-to-date"; git diff-index HEAD --; false )
fi
- |
if [ "$TRAVIS_OS_NAME" != "windows" ]
then
test -z $(goimports -e -d $GO_FILES | tee /dev/stderr)
fi
# goimports reports a lot of pseudo-diffs on Windows
# echo > goimports.out
# tail -f goimports.out &
# test -z "$(goimports -e -d $GO_FILES | tee goimports.out)"
- go test -tags ci ./...
- go vet -tags ci -unsafeptr=false ./...
# Windows golint alarm probably related to https://github.com/golang/lint/issues/157
- |
if [ "$TRAVIS_OS_NAME" != "windows" ]
then
golint -set_exit_status $(go list -tags ci ./...)
fi
- gocyclo -over 50 $GO_FILES
- |
set -e
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" == "false" && -n "$COVERALLS_TOKEN" ]]
then
go test -tags ci -covermode=atomic -coverprofile=coverage.out ./...
$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
fi
env:
global:
- secure: dxsvChfy84dx85yoDA08UQL9/uwuab2St/yzWGfI++tlY1yL+kUNTfaTTY0uiT6Fqwg8rfUdXPA95Z/9bwLPkMJ8p1zwRlxBKjzICTGjB/NDLUYWrZVW+kXOOWrLHEluccrAc5mvWY1/k6KaxqYslanIPOj8j9/7sZJBMsvH8teHjRDGn402sCIBO3SUwthGKktLuAUL5MCiVgo/Eym4mQ2a4OAbZBWqKRQ+7HJunbEzwA/2zOUm/WX3NTy8dg67yyPNLXgMarVsmRXRDYPMlSGfV6Y3kBGizhEGy/u8zXe17KmPjqEKDLWHZZxt0wWYVidERLk1EG2Sm0maIV0i6a+wunCLqQXKHPF8BDwZGftYNbbrED7+4Jnp2h5Y8fS5FlpNAgPZp4YWbOhMpZIhahms3qwGloTGrCj+YvnUu6wnKOnhsvcz2Ibgi+pXr2/3H8lSjAg//P7wRYQN0pvIdacDRD0Vx10bENPAO2IKV7COv/NI0WLrBezDcRS4j60m4EgAdmambKye/mYqERY2P+2e1pMVcn4xaehXxfdyb5MGsZtIh7h0vP9LxVpj+mIVE/WDk36sWPVlTtumVioC5vhr087RrTOj3fNAjHeEMvJa5uiyKxT3UOCx6YORGHkH0i9fz/2QHCA2FBrOdTFv3oe1L2W23iqs9cSx+FxaVCE=
matrix:
include:
- go: 1.12.x
os: linux
env: GO111MODULE=on GOFLAGS=
- go: 1.13.x
os: linux
env: GO111MODULE=off GOFLAGS=
- go: 1.13.x
os: osx
env: GO111MODULE=off GOFLAGS=
- go: 1.13.x
os: windows
env: GO111MODULE=off GOFLAGS=
- go: 1.14.x
os: linux
env: GO111MODULE=on GOFLAGS=
- go: 1.14.x
os: osx
env: GO111MODULE=on GOFLAGS=-mod=vendor
- go: 1.14.x
os: windows
env: GO111MODULE=off GOFLAGS=
- go: 1.14.x
os: linux
env: GO111MODULE=on GOFLAGS=-tags=mobile