forked from u-root/u-root
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yml
176 lines (176 loc) · 5.24 KB
/
config.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
version: 2
workflows:
version: 2
build_and_test:
jobs:
- clean-code
- test:
requires:
- clean-code
- test-integration-amd64:
requires:
- clean-code
- test-integration-arm:
requires:
- clean-code
- race:
requires:
- clean-code
- compile_cmds:
requires:
- clean-code
- check_licenses:
requires:
- clean-code
jobs:
clean-code:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Install dep
command: |
wget https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
mv dep-linux-amd64 dep
chmod +x dep
- run:
name: Install gometalinter
command: |
go get -u golang.org/x/lint/golint
go get github.com/alecthomas/gometalinter
- run:
name: Install ineffassign
command: go get github.com/gordonklaus/ineffassign
- run:
name: Check vendored dependencies
command: |
./dep version
./dep status
./dep ensure -vendor-only
git status
if [[ -n "$(git status --porcelain vendor)" ]]; then
echo 'vendor/ is out-of-date: run `dep ensure -vendor-only` and then check in the changes'
echo 'If `dep ensure` results in no changes, make sure you are using the latest relase of dep'
git status --porcelain vendor
exit 1
fi
- run:
name: vet
command: |
go tool vet cmds xcmds pkg
go tool vet u-root.go
- run:
name: gofmt
command: |
test -z "$(gofmt -s -l $(go list ./... | grep -v /vendor/))"
- run:
name: gometalinter
command: |
gometalinter --vendor ./... --disable-all --enable=golint \
--skip=pkg/uroot/test \
--skip=cmds/elvish \
--exclude="exported (function|type|const|method|var) (\w|_|\.)+ should have comment" \
--exclude="don't use underscores" \
--exclude="don't use ALL_CAPS" \
--exclude="comment on exported (function|type|const|method|var) (\w|_|\.)+ should be of the form" \
--exclude="package comment should be of the form" \
--exclude="(function|type|const|method|var|type field|struct field) (\w|_|\.)+ should be (\w|_|\.)+" \
--exclude="stutter" \
--exclude="which can be annoying to use"
- run:
name: ineffassign
command: ineffassign .
test:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Test all
command: go test -a -ldflags '-s' ./...
- run:
name: Test coverage
command: go test -cover ./...
test-integration-amd64:
docker:
- image: uroottest/test-image-amd64:v3.2.3
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Test integration amd64
command: go test -v -a -ldflags '-s' ./integration/...
- store_artifacts:
path: integration/serial
test-integration-arm:
docker:
- image: uroottest/test-image-arm:v3.0.0
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Test integration arm
command: go test -v -a -ldflags '-s' ./integration/...
- store_artifacts:
path: integration/serial
race:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 1
steps:
- checkout
- run:
name: Race detector
command: go test -race ./...
compile_cmds:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: build all tools
command: |
cd cmds
go install -a ./...
cd ../tools
go install -a ./...
cd ../xcmds
go install -a ./...
check_licenses:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Check licenses
command: go run scripts/checklicenses/checklicenses.go
check_symlinks:
docker:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
steps:
- checkout
- run:
name: Symbol tests to ensure we do not break symlink handling
command: mkdir /tmp/usr && ln -s /tmp/usr/x /tmp/usr/y && go run u-root.go -build=bb -files /tmp/usr minimal