From 70b37dc469ee8581564add1dffd9a419edf5d7b4 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 2 Sep 2015 14:02:36 +0200 Subject: [PATCH] Add specific build setup for CircleCI --- circle.yml | 25 +++++++++++++++++++++++++ script/circle-installgo.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 circle.yml create mode 100755 script/circle-installgo.sh diff --git a/circle.yml b/circle.yml new file mode 100644 index 000000000..32d35dd96 --- /dev/null +++ b/circle.yml @@ -0,0 +1,25 @@ +machine: + environment: + GOROOT: ${HOME}/go1.5 + GOARM: 5 + GO386: 387 + PATH: ${HOME}/go1.5/bin:${PATH} + +dependencies: + cache_directories: + - ~/go1.5 + override: + # Make sure our desired go version is installed + - ./script/circle-installgo.sh + - go version + +test: + override: + # First install latest versions of all dependencies + - go get -v -t -d ./... + # Build the binaries with those + - go build -v ./cmd/... + # And run the tests + - go test -v -short ./... + # Build all packages, using the vendored dependencies. + - ./build.sh all diff --git a/script/circle-installgo.sh b/script/circle-installgo.sh new file mode 100755 index 000000000..f81294732 --- /dev/null +++ b/script/circle-installgo.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -euo pipefail + +[ -d ~/go1.5 ] && exit + +# Install the version of Go that we want + +curl -s https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz \ + | tar -C ~ --transform s/go/go1.5/ -zx + +# Build the standard library for all our cross compilation targets. We do that +# here so that it gets cached and we don't need to repeat it for every build. + +for GOOS in darwin dragonfly solaris; do + export GOOS + export GOARCH=amd64 + echo $GOOS $GOARCH + go install std +done + +for GOOS in freebsd linux netbsd openbsd windows; do + for GOARCH in amd64 386; do + export GOOS + export GOARCH + echo $GOOS $GOARCH + go install std + done +done + +export GOOS=linux +export GOARCH=arm +echo $GOOS $GOARCH +go install std