LoginSignup
4
5

More than 5 years have passed since last update.

CircleCIで複数のバージョンのGo言語をテストしてみた。

Last updated at Posted at 2016-04-15
circle.yml
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

使うタイミングとしては、現在1.5で開発しているけど、そろそろバージョンを上げたいとか

まだ考えていないけどテストは常に行っていたいとかそういうアレかな

詳しくはgist

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5