forked from u-root/u-root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
200 lines (197 loc) · 6.22 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
version: 2
templates:
golang-template: &golang-template
docker:
- image: uroottest/test-image-amd64:v3.2.12
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
# Triple all timeouts for QEMU VM tests since they run without KVM.
- UROOT_QEMU_TIMEOUT_X: 3
integration-template: &integration-template
working_directory: /go/src/github.com/u-root/u-root
environment:
- CGO_ENABLED: 0
# Triple all timeouts for QEMU VM tests since they run without KVM.
- UROOT_QEMU_TIMEOUT_X: 3
steps:
- checkout
- run:
name: Test integration
command: go test -a -v -timeout 15m -ldflags '-s' ./integration/...
no_output_timeout: 15m
beefy-template: &beefy-template
<<: *golang-template
resource_class: large
workflows:
version: 2
build_and_test:
jobs:
- clean-code
- test:
requires:
- clean-code
- test-build:
requires:
- clean-code
- test-integration-amd64:
requires:
- clean-code
- test-integration-arm:
requires:
- clean-code
- test-integration-arm64:
requires:
- clean-code
- race:
requires:
- clean-code
- compile_cmds:
requires:
- clean-code
- check_licenses:
requires:
- clean-code
jobs:
clean-code:
<<: *golang-template
steps:
- checkout
- run:
name: Install dep
command: |
wget https://github.com/golang/dep/releases/download/v0.5.4/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 vet -composites=false ./cmds/... ./pkg/... ./
- run:
name: gofmt
command: |
test -z "$(gofmt -s -l $(find -name '*.go' | grep -v /vendor/))"
- run:
name: gometalinter
command: |
gometalinter --vendor ./... --disable-all --enable=golint \
--skip=pkg/uroot/test \
--skip=cmds/core/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:
<<: *golang-template
steps:
- checkout
- run:
name: Test all
command: go test -a -timeout 15m -ldflags '-s' ./cmds/... ./pkg/...
no_output_timeout: 15m
- run:
name: Test coverage
command: go test -cover ./cmds/... ./pkg/...
test-build:
<<: *beefy-template
steps:
- checkout
- run:
name: Test u-root build
command: go test -a -timeout 15m .
no_output_timeout: 15m
race:
<<: *golang-template
environment:
- CGO_ENABLED: 1
steps:
- checkout
- run:
name: Race detector
command: go test -race ./cmds/... ./pkg/...
compile_cmds:
<<: *golang-template
steps:
- checkout
- run:
name: build all tools
command: |
cd cmds
go install -a ./...
cd ../tools
go install -a ./...
check_licenses:
<<: *golang-template
steps:
- checkout
- run:
name: Check licenses
command: go run tools/checklicenses/checklicenses.go -c tools/checklicenses/config.json
check_symlinks:
<<: *golang-template
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
check_templates:
<<: *golang-template
steps:
- checkout
- run:
name: ensure that every template builds for a variety of options.
command: |
go run u-root.go -build=bb minimal
go run u-root.go minimal
go run u-root.go -build=bb core
go run u-root.go core
go run u-root.go -build=bb coreboot-app
go run u-root.go coreboot-app
go run u-root.go -build=bb all
go run u-root.go all
go run u-root.go -build=bb all core
go run u-root.go all core
go run u-root.go -fourbins minimal
go build .
GOOS=plan9 ./u-root plan9 -defaultsh=/bbin/rush
test-integration-amd64:
<<: *integration-template
docker:
- image: uroottest/test-image-amd64:v3.2.12
test-integration-arm:
<<: *integration-template
docker:
- image: uroottest/test-image-arm:v3.0.4
test-integration-arm64:
<<: *integration-template
docker:
- image: uroottest/test-image-arm64:v0.0.1
working_directory: /home/circleci/go/src/github.com/u-root/u-root