github.com/oweisse/u-root@v0.0.0-20181109060735-d005ad25fef1/.circleci/config.yml (about) 1 version: 2 2 workflows: 3 version: 2 4 build_and_test: 5 jobs: 6 - clean-code 7 - test: 8 requires: 9 - clean-code 10 - test-integration: 11 requires: 12 - clean-code 13 - race: 14 requires: 15 - clean-code 16 - compile_cmds: 17 requires: 18 - clean-code 19 - bb_amd64: 20 requires: 21 - clean-code 22 - bb_arm7: 23 requires: 24 - clean-code 25 - bb_arm64: 26 requires: 27 - clean-code 28 - bb_ppc64le: 29 requires: 30 - clean-code 31 - source_amd64: 32 requires: 33 - clean-code 34 - source_amd64_test_archive: 35 requires: 36 - clean-code 37 - extra_files: 38 requires: 39 - clean-code 40 - extra_files_multiple_files: 41 requires: 42 - clean-code 43 - extra_files_comma_syntax: 44 requires: 45 - clean-code 46 - extra_files_multiple_files_mixed_syntax: 47 requires: 48 - clean-code 49 - extra_files_wrong_comma_syntax: 50 requires: 51 - clean-code 52 - check_licenses: 53 requires: 54 - clean-code 55 - check_hosted_source: 56 requires: 57 - clean-code 58 - check_hosted_busybox: 59 requires: 60 - clean-code 61 - check_symlinks: 62 requires: 63 - clean-code 64 jobs: 65 clean-code: 66 docker: 67 - image: circleci/golang:1.11 68 working_directory: /go/src/github.com/u-root/u-root 69 steps: 70 - checkout 71 - run: 72 name: Install dep 73 command: | 74 wget https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 75 mv dep-linux-amd64 dep 76 chmod +x dep 77 - run: 78 name: Install gometalinter 79 command: | 80 go get -u golang.org/x/lint/golint 81 go get github.com/alecthomas/gometalinter 82 - run: 83 name: Install ineffassign 84 command: go get github.com/gordonklaus/ineffassign 85 - run: 86 name: Check vendored dependencies 87 command: | 88 ./dep version 89 ./dep status 90 ./dep ensure -vendor-only 91 git status 92 if [[ -n "$(git status --porcelain vendor)" ]]; then 93 echo 'vendor/ is out-of-date: run `dep ensure -vendor-only` and then check in the changes' 94 echo 'If `dep ensure` results in no changes, make sure you are using the latest relase of dep' 95 git status --porcelain vendor 96 exit 1 97 fi 98 - run: 99 name: vet 100 command: | 101 go tool vet cmds xcmds pkg 102 go tool vet u-root.go 103 - run: 104 name: gofmt 105 command: | 106 test -z "$(gofmt -s -l $(go list ./... | grep -v /vendor/))" 107 - run: 108 name: gometalinter 109 command: | 110 gometalinter --vendor ./... --disable-all --enable=golint \ 111 --skip=pkg/uroot/test \ 112 --skip=cmds/elvish \ 113 --exclude="exported (function|type|const|method|var) (\w|_|\.)+ should have comment" \ 114 --exclude="don't use underscores" \ 115 --exclude="don't use ALL_CAPS" \ 116 --exclude="comment on exported (function|type|const|method|var) (\w|_|\.)+ should be of the form" \ 117 --exclude="package comment should be of the form" \ 118 --exclude="(function|type|const|method|var|type field|struct field) (\w|_|\.)+ should be (\w|_|\.)+" \ 119 --exclude="stutter" \ 120 --exclude="which can be annoying to use" 121 - run: 122 name: ineffassign 123 command: ineffassign . 124 test: 125 docker: 126 - image: circleci/golang:1.11 127 working_directory: /go/src/github.com/u-root/u-root 128 environment: 129 - CGO_ENABLED: 0 130 steps: 131 - checkout 132 - run: 133 name: Test all 134 command: go test -a -ldflags '-s' ./pkg/... ./cmds/... ./xcmds/... 135 - run: 136 name: Test coverage 137 command: go test -cover ./pkg/... ./cmds/... ./xcmds/... 138 test-integration: 139 docker: 140 - image: uroottest/x86-integration:latest 141 working_directory: /go/src/github.com/u-root/u-root 142 environment: 143 - CGO_ENABLED: 0 144 steps: 145 - checkout 146 - run: 147 name: Test integration all 148 command: go test -v -a -ldflags '-s' ./integration/... 149 - store_artifacts: 150 path: integration/serial 151 race: 152 docker: 153 - image: circleci/golang:1.11 154 working_directory: /go/src/github.com/u-root/u-root 155 environment: 156 - CGO_ENABLED: 1 157 steps: 158 - checkout 159 - run: 160 name: Race detector 161 command: go test -race ./pkg/... ./cmds/... ./xcmds/... 162 bb_amd64: 163 docker: 164 - image: circleci/golang:1.11 165 working_directory: /go/src/github.com/u-root/u-root 166 environment: 167 - CGO_ENABLED: 0 168 steps: 169 - checkout 170 - run: 171 name: Build u-root 172 command: go build u-root.go 173 - run: 174 name: First bb build 175 command: | 176 ./u-root -build=bb 177 mv /tmp/initramfs.linux_amd64.cpio /tmp/initramfs.linux_amd64.cpio.1 178 - run: 179 name: Second bb build 180 command: ./u-root -build=bb 181 - run: 182 name: cmp bb test output (test reproducibility) 183 command: cmp /tmp/initramfs.linux_amd64.cpio /tmp/initramfs.linux_amd64.cpio.1 184 - run: 185 name: Compress cpio 186 command: lzma -9 /tmp/initramfs.linux_amd64.cpio 187 - store_artifacts: 188 path: /tmp/initramfs.linux_amd64.cpio.lzma 189 destination: bb_initramfs.linux_amd64.cpio.lzma 190 - store_artifacts: 191 path: /tmp/initramfs.linux_amd64.cpio.1 192 destination: bb_initramfs.linux_amd64.cpio.1 193 bb_arm7: 194 docker: 195 - image: circleci/golang:1.11 196 working_directory: /go/src/github.com/u-root/u-root 197 environment: 198 - CGO_ENABLED: 0 199 - GOARCH: arm 200 - GOARM: 7 201 steps: 202 - checkout 203 - run: 204 name: Build u-root 205 environment: 206 - GOARCH: amd64 207 command: go build u-root.go 208 - run: 209 name: ARM7 test build 210 command: ./u-root -build=bb 211 - run: 212 name: Compress cpio 213 command: lzma -9 /tmp/initramfs.linux_arm.cpio 214 - store_artifacts: 215 path: /tmp/initramfs.linux_arm.cpio.lzma 216 destination: bb_initramfs.linux_arm.cpio.lzma 217 bb_arm64: 218 docker: 219 - image: circleci/golang:1.11 220 working_directory: /go/src/github.com/u-root/u-root 221 environment: 222 - CGO_ENABLED: 0 223 - GOARCH: arm64 224 steps: 225 - checkout 226 - run: 227 name: Build u-root 228 environment: 229 - GOARCH: amd64 230 command: go build u-root.go 231 - run: 232 name: ARM64 test build 233 command: ./u-root -build=bb 234 - run: 235 name: Compress cpio 236 command: lzma -9 /tmp/initramfs.linux_arm64.cpio 237 - store_artifacts: 238 path: /tmp/initramfs.linux_arm64.cpio.lzma 239 destination: bb_initramfs.linux_arm64.cpio.lzma 240 bb_ppc64le: 241 docker: 242 - image: circleci/golang:1.11 243 working_directory: /go/src/github.com/u-root/u-root 244 environment: 245 - CGO_ENABLED: 0 246 - GOARCH: ppc64le 247 steps: 248 - checkout 249 - run: 250 name: Build u-root 251 environment: 252 - GOARCH: amd64 253 command: go build u-root.go 254 - run: 255 name: ppc64le test build 256 command: ./u-root -build=bb 257 - run: 258 name: Compress cpio 259 command: lzma -9 /tmp/initramfs.linux_ppc64le.cpio 260 - store_artifacts: 261 path: /tmp/initramfs.linux_ppc64le.cpio.lzma 262 destination: bb_initramfs.linux_ppc64le.cpio.lzma 263 compile_cmds: 264 docker: 265 - image: circleci/golang:1.11 266 working_directory: /go/src/github.com/u-root/u-root 267 environment: 268 - CGO_ENABLED: 0 269 steps: 270 - checkout 271 - run: 272 name: build all tools 273 command: | 274 cd cmds 275 go install -a ./... 276 cd ../tools 277 go install -a ./... 278 cd ../xcmds 279 go install -a ./... 280 source_amd64: 281 docker: 282 - image: circleci/golang:1.11 283 working_directory: /go/src/github.com/u-root/u-root 284 environment: 285 - CGO_ENABLED: 0 286 steps: 287 - checkout 288 - run: 289 name: Build u-root 290 environment: 291 - GOARCH: amd64 292 command: go build u-root.go 293 - run: 294 name: Build ramfs 295 command: ./u-root -build=source --tmpdir=/tmp/u-root 296 - run: 297 name: Compress cpio 298 command: lzma -9 /tmp/initramfs.linux_amd64.cpio 299 - store_artifacts: 300 path: /tmp/initramfs.linux_amd64.cpio.lzma 301 destination: source_initramfs.linux_amd64.cpio.lzma 302 source_amd64_test_archive: 303 docker: 304 - image: circleci/golang:1.11 305 working_directory: /go/src/github.com/u-root/u-root 306 environment: 307 - CGO_ENABLED: 0 308 steps: 309 - checkout 310 - run: 311 name: Install cpio 312 command: sudo apt-get install cpio 313 - run: 314 name: Build u-root 315 environment: 316 - GOARCH: amd64 317 command: go build u-root.go 318 - run: 319 name: Build ramfs 320 command: ./u-root -build=source --tmpdir=/tmp/u-root 321 - run: 322 name: make test directory 323 command: mkdir /tmp/u-root-test 324 - run: 325 name: extract archive 326 command: cpio -i -d --no-absolute-filenames "go/*" < /tmp/initramfs.linux_amd64.cpio 327 working_directory: /tmp/u-root-test 328 - run: 329 name: run go build 330 command: GOPATH=$(pwd) GOROOT=$(pwd)/go ./go/bin/go build ./go/src/... 331 working_directory: /tmp/u-root-test 332 extra_files: 333 docker: 334 - image: circleci/golang:1.11 335 working_directory: /go/src/github.com/u-root/u-root 336 environment: 337 - CGO_ENABLED: 0 338 steps: 339 - checkout 340 - run: 341 name: Install cpio 342 command: sudo apt-get install cpio 343 - run: 344 name: Build u-root 345 environment: 346 - GOARCH: amd64 347 command: go build u-root.go 348 - run: 349 name: Build ramfs 350 command: ./u-root -build=bb --tmpdir=/tmp/u-root -files ///bin/bash 351 - run: 352 name: make test directory 353 command: mkdir /tmp/u-root-test 354 - run: 355 name: extract archive 356 command: cpio -i -d --no-absolute-filenames "bin/bash" < /tmp/initramfs.linux_amd64.cpio 357 working_directory: /tmp/u-root-test 358 extra_files_multiple_files: 359 docker: 360 - image: circleci/golang:1.11 361 working_directory: /go/src/github.com/u-root/u-root 362 environment: 363 - CGO_ENABLED: 0 364 steps: 365 - checkout 366 - run: 367 name: Install cpio 368 command: sudo apt-get install cpio 369 - run: 370 name: Build u-root 371 environment: 372 - GOARCH: amd64 373 command: go build u-root.go 374 - run: 375 name: Create sample file 376 command: mkdir sample && touch sample/file 377 - run: 378 name: Build ramfs 379 command: ./u-root -build=bb --tmpdir=/tmp/u-root -files /bin/bash -files /bin/ls -files sample/file 380 - run: 381 name: make test directory 382 command: mkdir /tmp/u-root-test 383 - run: 384 name: extract archive 385 command: cpio -i -d --no-absolute-filenames "bin/bash bin/ls sample/file" < /tmp/initramfs.linux_amd64.cpio 386 working_directory: /tmp/u-root-test 387 extra_files_comma_syntax: 388 docker: 389 - image: circleci/golang:1.11 390 working_directory: /go/src/github.com/u-root/u-root 391 environment: 392 - CGO_ENABLED: 0 393 steps: 394 - checkout 395 - run: 396 name: Install cpio 397 command: sudo apt-get install cpio 398 - run: 399 name: Build u-root 400 environment: 401 - GOARCH: amd64 402 command: go build u-root.go 403 - run: 404 name: Build ramfs 405 command: ./u-root -build=bb --tmpdir=/tmp/u-root -files /bin/bash:bin/bush 406 - run: 407 name: make test directory 408 command: mkdir /tmp/u-root-test 409 - run: 410 name: extract archive 411 command: cpio -i -d --no-absolute-filenames "bin/bush" < /tmp/initramfs.linux_amd64.cpio 412 working_directory: /tmp/u-root-test 413 extra_files_multiple_files_mixed_syntax: 414 docker: 415 - image: circleci/golang:1.11 416 working_directory: /go/src/github.com/u-root/u-root 417 environment: 418 - CGO_ENABLED: 0 419 steps: 420 - checkout 421 - run: 422 name: Install cpio 423 command: sudo apt-get install cpio 424 - run: 425 name: Build u-root 426 environment: 427 - GOARCH: amd64 428 command: go build u-root.go 429 - run: 430 name: Build ramfs 431 command: ./u-root -build=bb --tmpdir=/tmp/u-root -files /bin/bash:bin/bush -files /bin/ls:ls 432 - run: 433 name: make test directory 434 command: mkdir /tmp/u-root-test 435 - run: 436 name: extract archive 437 command: cpio -i -d --no-absolute-filenames "bin/bush ls" < /tmp/initramfs.linux_amd64.cpio 438 working_directory: /tmp/u-root-test 439 extra_files_wrong_comma_syntax: 440 docker: 441 - image: circleci/golang:1.11 442 working_directory: /go/src/github.com/u-root/u-root 443 environment: 444 - CGO_ENABLED: 0 445 steps: 446 - checkout 447 - run: 448 name: Install cpio 449 command: sudo apt-get install cpio 450 - run: 451 name: Build u-root 452 environment: 453 - GOARCH: amd64 454 command: go build u-root.go 455 - run: 456 name: Build ramfs 457 command: if ./u-root -build=bb --tmpdir=/tmp/u-root -files /bin/bash:/bin/bash; then exit 1; else exit 0; fi 458 check_licenses: 459 docker: 460 - image: circleci/golang:1.11 461 working_directory: /go/src/github.com/u-root/u-root 462 environment: 463 - CGO_ENABLED: 0 464 steps: 465 - checkout 466 - run: 467 name: Check licenses 468 command: go run scripts/checklicenses/checklicenses.go 469 check_hosted_source: 470 docker: 471 - image: circleci/golang:1.11 472 working_directory: /go/src/github.com/u-root/u-root 473 environment: 474 - CGO_ENABLED: 0 475 steps: 476 - checkout 477 - run: 478 name: Build hosted source initramfs with no defaultsh or init symlink, no base cpio 479 command: go run u-root.go -base=/dev/null -defaultsh="" -initcmd="" 480 check_hosted_busybox: 481 docker: 482 - image: circleci/golang:1.11 483 working_directory: /go/src/github.com/u-root/u-root 484 environment: 485 - CGO_ENABLED: 0 486 steps: 487 - checkout 488 - run: 489 name: Build hosted busybox initramfs with no defaultsh or init symlink, no base cpio 490 command: go run u-root.go -build=bb -base=/dev/null -defaultsh="" -initcmd="" 491 check_symlinks: 492 docker: 493 - image: circleci/golang:1.11 494 working_directory: /go/src/github.com/u-root/u-root 495 environment: 496 - CGO_ENABLED: 0 497 steps: 498 - checkout 499 - run: 500 name: Symbol tests to ensure we do not break symlink handling 501 command: mkdir /tmp/usr && ln -s /tmp/usr/x /tmp/usr/y && go run u-root.go -build=bb -files /tmp/usr minimal