Skip to content

Instantly share code, notes, and snippets.

@azihsoyn
Created March 23, 2018 13:02
Show Gist options
  • Save azihsoyn/9ffdbf109767827f17f1ad03f348785b to your computer and use it in GitHub Desktop.
Save azihsoyn/9ffdbf109767827f17f1ad03f348785b to your computer and use it in GitHub Desktop.
version: 2
jobs:
build:
working_directory: /go/src/github.com/your_company/your_app
docker:
- image: circleci/golang:1.10.0
environment:
- GOCACHE: "/tmp/go/cache"
steps:
...
- restore_cache:
keys:
- build-cache-{{ .Branch }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
paths:
- /tmp/go/cache
- run:
name: test
command: |
mkdir -p $GOCACHE
go build -v
go test -p 6 -race ./...
- save_cache:
key: build-cache-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }}
paths:
- /tmp/go/cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment