Skip to content

Instantly share code, notes, and snippets.

@Dynom
Created September 13, 2016 07:45
Show Gist options
  • Save Dynom/56d03538c2fdc0470fb5d649569c21fc to your computer and use it in GitHub Desktop.
Save Dynom/56d03538c2fdc0470fb5d649569c21fc to your computer and use it in GitHub Desktop.
A Go CircleCI config file
checkout:
post:
# Remove a CircleCI directive that confuses our override, if it exists..
- git config --global --unset "[email protected]:.insteadof" ; if [ $? -eq 0 -o $? -eq 5 ]; then true; else false; fi; echo $?
- git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
dependencies:
pre:
# Temporary, using Go 1.7
- curl -O https://storage.googleapis.com/golang/go1.7.linux-amd64.tar.gz && tar -xvf go1.7.linux-amd64.tar.gz && sudo bash -c 'rm -rf /usr/local/go && mv go /usr/local'
- go get -u github.com/alecthomas/gometalinter && gometalinter -ui
- go get -u github.com/jstemmer/go-junit-report
# Nuking outdated caches that might give problems between language updates
# see https://github.com/golang/go/issues/12703
- rm -rf /home/ubuntu/.go_workspace/pkg/*
test:
pre:
- GOPATH=~/.go_project:~/.go_workspace/ go get
- GOPATH=~/.go_project:~/.go_workspace/ gometalinter --vendored-linters -t --enable-gc -D dupl -D errcheck --vendor --cyclo-over=10 --deadline=5m -e "should have comment" -s "proto"
override:
- go test -v -bench=. $(go list ./... | grep -v vendor)
- go test -v $(go list ./... | grep -v vendor) | go-junit-report > report.xml
post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- find . -name "*.xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment