forked from google/periph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (40 loc) · 1.79 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
# Copyright 2019 The Periph Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
os: linux
dist: bionic
language: go
go_import_path: periph.io/x/periph
jobs:
include:
- go: 1.14.x
cache:
directories:
- $GOPATH/pkg/mod
# Cache tools sources.
#- $GOPATH/src/golang\.org
before_script:
- echo $TRAVIS_GO_VERSION
- go get -t -v periph.io/x/periph/...
- >
go get -u -v
golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
script:
- >
echo 'Looking for external dependencies:';
go list -f '{{join .Imports "\n"}}' periph.io/x/periph/... | sort | uniq | grep -v ^periph.io/x/periph | xargs go list -f '{{if not .Standard}}- {{.ImportPath}}{{end}}'
- >
echo 'Erroring on external dependencies:';
! go list -f '{{join .Imports "\n"}}' periph.io/x/periph/... | sort | uniq | grep -v ^periph.io/x/periph | xargs go list -f '{{if not .Standard}}Remove {{.ImportPath}}{{end}}' | grep -q Remove
- >
echo 'Erroring on /host depending on /devices:';
! go list -f '{{.ImportPath}} depends on {{join .Imports ", "}}' periph.io/x/periph/host/... | sort | uniq | grep periph.io/x/periph/devices
- >
echo 'Erroring on /conn depending on /devices:';
! go list -f '{{.ImportPath}} depends on {{join .Imports ", "}}' periph.io/x/periph/conn/... | sort | uniq | grep periph.io/x/periph/devices
- >
echo 'Erroring on /conn depending on /host:';
! go list -f '{{.ImportPath}} depends on {{join .Imports ", "}}' periph.io/x/periph/conn/... | sort | uniq | grep periph.io/x/periph/host
- >
echo 'Erroring on shadowed variables:';
! go vet -vettool=$(which shadow) ./... |& grep -v '"err"' | grep -e '^[^#]'