github.com/ratrocket/u-root@v0.0.0-20180201221235-1cf9f48ee2cf/.circleci/config.yml (about)

     1  version: 2
     2  workflows:
     3    version: 2
     4    build_and_test:
     5      jobs:
     6        - dep
     7        - test_cmds:
     8            requires:
     9              - dep
    10        - test_pkg:
    11            requires:
    12              - dep
    13        - compile_cmds:
    14            requires:
    15              - dep
    16        - bb_amd64:
    17            requires:
    18              - dep
    19        - bb_arm7:
    20            requires:
    21              - dep
    22        - bb_arm64:
    23            requires:
    24              - dep
    25        - bb_ppc64le:
    26            requires:
    27              - dep
    28        - source_amd64:
    29            requires:
    30              - dep
    31  jobs:
    32    dep:
    33      docker:
    34        - image: circleci/golang:latest
    35      working_directory: /go/src/github.com/u-root/u-root
    36      steps:
    37        - checkout
    38        - run:
    39            name: Install dep
    40            command: |
    41              cd vendor/github.com/golang/dep/cmd/dep
    42              go install
    43        - run:
    44            name: Check vendored dependencies
    45            command: dep status
    46        - run:
    47            name: Go vet
    48            command: go tool vet cmds pkg
    49    test_cmds:
    50      docker:
    51        - image: circleci/golang:latest
    52      working_directory: /go/src/github.com/u-root/u-root
    53      environment:
    54        - CGO_ENABLED: 0
    55      steps:
    56        - checkout
    57        - run:
    58            name: Test cmds
    59            command: |
    60              cd cmds
    61              go test -a -installsuffix uroot -ldflags '-s' ./...
    62        - run:
    63            name: Test coverage of cmds
    64            command: |
    65              cd cmds
    66              go test -cover ./...
    67    test_pkg:
    68      docker:
    69        - image: circleci/golang:latest
    70      working_directory: /go/src/github.com/u-root/u-root
    71      environment:
    72        - CGO_ENABLED: 0
    73      steps:
    74        - checkout
    75        - run:
    76            name: Test pkg
    77            command: |
    78              cd pkg
    79              go test -a -installsuffix uroot -ldflags '-s' ./...
    80        - run:
    81            name: Test coverage of pkg
    82            command: |
    83              cd pkg
    84              go test -cover ./...
    85    bb_amd64:
    86      docker:
    87        - image: circleci/golang:latest
    88      working_directory: /go/src/github.com/u-root/u-root
    89      environment:
    90        - CGO_ENABLED: 0
    91      steps:
    92        - checkout
    93        - run:
    94            name: Build u-root
    95            command: go build u-root.go
    96        - run:
    97            name: First bb build
    98            command: |
    99              ./u-root -build=bb
   100              mv /tmp/initramfs.linux_amd64.cpio /tmp/initramfs.linux_amd64.cpio.1
   101        - run:
   102            name: Second bb build
   103            command: ./u-root -build=bb
   104        - run:
   105            name: cmp bb test output (test reproducibility)
   106            command: cmp /tmp/initramfs.linux_amd64.cpio /tmp/initramfs.linux_amd64.cpio.1
   107        - run:
   108            name: Compress cpio
   109            command: lzma -9 /tmp/initramfs.linux_amd64.cpio
   110        - store_artifacts:
   111            path: /tmp/initramfs.linux_amd64.cpio.lzma
   112            destination: bb_initramfs.linux_amd64.cpio.lzma
   113    bb_arm7:
   114      docker:
   115        - image: circleci/golang:latest
   116      working_directory: /go/src/github.com/u-root/u-root
   117      environment:
   118        - CGO_ENABLED: 0
   119        - GOARCH: arm
   120        - GOARM: 7
   121      steps:
   122        - checkout
   123        - run:
   124            name: Build u-root
   125            environment:
   126              - GOARCH: amd64
   127            command: go build u-root.go
   128        - run:
   129            name: ARM7 test build
   130            command: ./u-root -build=bb
   131        - run:
   132            name: Compress cpio
   133            command: lzma -9 /tmp/initramfs.linux_arm.cpio
   134        - store_artifacts:
   135            path: /tmp/initramfs.linux_arm.cpio.lzma
   136            destination: bb_initramfs.linux_arm.cpio.lzma
   137    bb_arm64:
   138      docker:
   139        - image: circleci/golang:latest
   140      working_directory: /go/src/github.com/u-root/u-root
   141      environment:
   142        - CGO_ENABLED: 0
   143        - GOARCH: arm64
   144      steps:
   145        - checkout
   146        - run:
   147            name: Build u-root
   148            environment:
   149              - GOARCH: amd64
   150            command: go build u-root.go
   151        - run:
   152            name: ARM64 test build
   153            command: ./u-root -build=bb
   154        - run:
   155            name: Compress cpio
   156            command: lzma -9 /tmp/initramfs.linux_arm64.cpio
   157        - store_artifacts:
   158            path: /tmp/initramfs.linux_arm64.cpio.lzma
   159            destination: bb_initramfs.linux_arm64.cpio.lzma
   160    bb_ppc64le:
   161      docker:
   162        - image: circleci/golang:latest
   163      working_directory: /go/src/github.com/u-root/u-root
   164      environment:
   165        - CGO_ENABLED: 0
   166        - GOARCH: ppc64le
   167      steps:
   168        - checkout
   169        - run:
   170            name: Build u-root
   171            environment:
   172              - GOARCH: amd64
   173            command: go build u-root.go
   174        - run:
   175            name: ppc64le test build
   176            command: ./u-root -build=bb
   177        - run:
   178            name: Compress cpio
   179            command: lzma -9 /tmp/initramfs.linux_ppc64le.cpio
   180        - store_artifacts:
   181            path: /tmp/initramfs.linux_ppc64le.cpio.lzma
   182            destination: bb_initramfs.linux_ppc64le.cpio.lzma
   183    compile_cmds:
   184      docker:
   185        - image: circleci/golang:latest
   186      working_directory: /go/src/github.com/u-root/u-root
   187      environment:
   188        - CGO_ENABLED: 0
   189      steps:
   190        - checkout
   191        - run:
   192            name: build all tools
   193            command: |
   194              cd cmds
   195              go build -a -installsuffix uroot -ldflags '-s' ./...
   196    source_amd64:
   197      docker:
   198        - image: circleci/golang:latest
   199      working_directory: /go/src/github.com/u-root/u-root
   200      environment:
   201        - CGO_ENABLED: 0
   202      steps:
   203        - checkout
   204        - run:
   205            name: Build u-root
   206            environment:
   207              - GOARCH: amd64
   208            command: go build u-root.go
   209        - run:
   210            name: Build ramfs
   211            command: ./u-root -build=source --tmpdir=/tmp/u-root
   212        - run:
   213            name: Compress cpio
   214            command: lzma -9 /tmp/initramfs.linux_amd64.cpio
   215        - store_artifacts:
   216            path: /tmp/initramfs.linux_amd64.cpio.lzma
   217            destination: source_initramfs.linux_amd64.cpio.lzma