github.com/flammit/u-root@v0.0.0-20171208172043-8997438e8634/travis.sh (about)

     1  #!/bin/bash
     2  if [ -z "${GOPATH}" ]; then
     3          export GOPATH=/home/travis/gopath
     4  fi
     5  set -e
     6  
     7  echo "Check vendored dependencies"
     8   (dep status)
     9  
    10  echo "Build u-root"
    11   (go build u-root.go)
    12  
    13  echo "-----------------------> Initial bb test"
    14   (./u-root -build=bb)
    15  mv /tmp/initramfs.linux_amd64.cpio /tmp/i2
    16  
    17  # Test for reproducible initramfs in busybox mode
    18  echo "-----------------------> Second bb test"
    19   (./u-root -build=bb)
    20  
    21  echo "-----------------------> cmp bb test output (test reproducibility)"
    22  cmp /tmp/initramfs.linux_amd64.cpio /tmp/i2
    23   which go
    24  
    25  # Test all architectures we care about. At some point we may just
    26  # grow the build matrix.
    27  echo "-----------------------> ARM64 test build"
    28   (GOARCH=arm64 ./u-root -build=bb)
    29  echo "-----------------------> ppc64le test build"
    30   (GOARCH=ppc64le ./u-root -build=bb)
    31  
    32  echo "-----------------------> First ramfs test"
    33   (./u-root -build=source --tmpdir=/tmp/u-root)
    34  
    35  echo "-----------------------> build all tools"
    36   (cd cmds && CGO_ENABLED=0 go build -a -installsuffix uroot -ldflags '-s' ./...)
    37  
    38  echo "-----------------------> What got built? ls -l cmds/*"
    39   ls -l cmds/*
    40  
    41  echo "-----------------------> go test"
    42   (cd cmds && CGO_ENABLED=0 go test -a -installsuffix uroot -ldflags '-s' ./...)
    43  
    44  echo "-----------------------> test -cover"
    45   (cd cmds && CGO_ENABLED=0 go test -cover ./...)
    46   (cd pkg && CGO_ENABLED=0 go test -cover ./...)
    47  
    48  echo "-----------------------> go vet"
    49    (go tool vet cmds pkg)
    50  
    51  # is it go-gettable?
    52  echo "-----------------------> test go-gettable"
    53   (go get github.com/u-root/u-root)
    54  
    55  echo "Did it blend"