travis: Enable arm64 builds
Setup a travis test matrix on a new variable 'TARGET', which specifies the CI target. Update the script section with a conditional that runs the needed commands for each target. Also, set go_import_path to make cloned repos work, enable the trusty VM, and enable verbose builds when testing. Signed-off-by: Geoff Levand <geoff@infradead.org>release-3.0
parent
00d6f104b5
commit
b79bb6f164
19
.travis.yml
19
.travis.yml
|
@ -1,4 +1,6 @@
|
||||||
|
dist: trusty
|
||||||
language: go
|
language: go
|
||||||
|
go_import_path: github.com/coreos/etcd
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
go:
|
go:
|
||||||
|
@ -6,6 +8,13 @@ go:
|
||||||
- 1.6
|
- 1.6
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- GO15VENDOREXPERIMENT=1
|
||||||
|
matrix:
|
||||||
|
- TARGET=amd64
|
||||||
|
- TARGET=arm64
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- go: tip
|
- go: tip
|
||||||
|
@ -17,9 +26,6 @@ addons:
|
||||||
- libaspell-dev
|
- libaspell-dev
|
||||||
- libhunspell-dev
|
- libhunspell-dev
|
||||||
|
|
||||||
env:
|
|
||||||
- GO15VENDOREXPERIMENT=1
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- go get -v github.com/chzchzchz/goword
|
- go get -v github.com/chzchzchz/goword
|
||||||
- go get -v honnef.co/go/simple/cmd/gosimple
|
- go get -v honnef.co/go/simple/cmd/gosimple
|
||||||
|
@ -30,4 +36,9 @@ install:
|
||||||
- pushd cmd/ && go get -t -v ./... && popd
|
- pushd cmd/ && go get -t -v ./... && popd
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./test
|
- >
|
||||||
|
if [ "${TARGET}" == "amd64" ]; then
|
||||||
|
GOARCH="${TARGET}" ./test;
|
||||||
|
elif [ "${TARGET}" == "arm64" ]; then
|
||||||
|
GOARCH="${TARGET}" ./build;
|
||||||
|
fi
|
||||||
|
|
12
build
12
build
|
@ -11,6 +11,14 @@ GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"`
|
||||||
|
|
||||||
LINK_OPERATOR="="
|
LINK_OPERATOR="="
|
||||||
|
|
||||||
|
host_arch=$(GOARCH="" go env | egrep 'GOARCH=' | cut --delimiter='"' --field=2)
|
||||||
|
|
||||||
|
if [ -z "${GOARCH}" ] || [ "${GOARCH}" = "${host_arch}" ]; then
|
||||||
|
out="bin"
|
||||||
|
else
|
||||||
|
out="bin/${GOARCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Static compilation is useful when etcd is run in a container
|
# Static compilation is useful when etcd is run in a container
|
||||||
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA${LINK_OPERATOR}${GIT_SHA}" -o bin/etcd ${REPO_PATH}/cmd
|
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA${LINK_OPERATOR}${GIT_SHA}" -o ${out}/etcd ${REPO_PATH}/cmd
|
||||||
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s" -o bin/etcdctl ${REPO_PATH}/cmd/etcdctl
|
CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "-s" -o ${out}/etcdctl ${REPO_PATH}/cmd/etcdctl
|
||||||
|
|
2
test
2
test
|
@ -17,7 +17,7 @@ GOSIMPLE_UNUSED_PATHS=$(go list ./... | sed -e 's/github.com\/coreos\/etcd\///g'
|
||||||
# Invoke ./cover for HTML output
|
# Invoke ./cover for HTML output
|
||||||
COVER=${COVER:-"-cover"}
|
COVER=${COVER:-"-cover"}
|
||||||
|
|
||||||
GO_BUILD_FLAGS=-a
|
GO_BUILD_FLAGS="-a -v"
|
||||||
source ./build
|
source ./build
|
||||||
|
|
||||||
# Set up gopath so tests use vendored dependencies
|
# Set up gopath so tests use vendored dependencies
|
||||||
|
|
Loading…
Reference in New Issue