Skip to content

Instantly share code, notes, and snippets.

@shinofara
Last active July 2, 2018 05:27
Show Gist options
  • Save shinofara/0a2868572f227cdf2faca73ac4b44000 to your computer and use it in GitHub Desktop.
Save shinofara/0a2868572f227cdf2faca73ac4b44000 to your computer and use it in GitHub Desktop.
CircleCIで複数のバージョンのGo言語をテストしてみた。
machine:
environment:
GO15VENDOREXPERIMENT: 1
GOROOT: "/home/ubuntu/go"
PATH: "/home/ubuntu/go/bin:$PATH"
dependencies:
cache_directories:
- "/home/ubuntu/.go"
pre:
- >
case $CIRCLE_NODE_INDEX in 0) export GOVERSION=1.5.1 ;; 1) export GOVERSION=1.6.1 ;; esac;
cd /home/ubuntu;
if [[ ! -e /home/ubuntu/.go/$GOERSION/bin/go ]]; then
curl https://storage.googleapis.com/golang/go$GOVERSION.linux-amd64.tar.gz | tar -xz;
go get -u github.com/jstemmer/go-junit-report;
mkdir -p ~/.go;
cp -rp ~/go ~/.go/$GOVERSION;
else
cp -rp ~/.go/$GOVERSION ~/go;
fi
- go version
test:
override:
- mkdir -p $CIRCLE_TEST_REPORTS/golang:
parallel: true
- go test -v $(go list ./...|grep -v vendor) | go-junit-report set-exit-code=true > $CIRCLE_TEST_REPORTS/golang/$CIRCLE_NODE_INDEX.xml:
parallel: true
@shinofara
Copy link
Author

使うタイミングとしては、現在1.5で開発しているけど、そろそろバージョンを上げたいとか
まだ考えていないけどテストは常に行っていたいとかそういうアレかな

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment