diff options
author | Matt Joiner <anacrolix@gmail.com> | 2020-09-10 09:57:03 +1000 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2020-09-10 09:57:03 +1000 |
commit | 5df0d3b6be092f6d48c09ff0c98a07ba4e8afa05 (patch) | |
tree | 07ad41c85485a052fc034d6db272c3fff99388b3 | |
parent | Document that Operation return value isn't in the examples (diff) | |
download | stm-5df0d3b6be092f6d48c09ff0c98a07ba4e8afa05.tar.gz stm-5df0d3b6be092f6d48c09ff0c98a07ba4e8afa05.tar.xz |
Copy circle CI config from anacrolix/dht
-rw-r--r-- | .circleci/config.yml | 70 |
1 files changed, 49 insertions, 21 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index af257f0..0db2f6b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,26 +1,54 @@ -# Golang CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-go/ for more details version: 2 jobs: build: - docker: - # specify the version - - image: circleci/golang:1.9 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - #### TEMPLATE_NOTE: go expects specific checkout path representing url - #### expecting it in the form of - #### /go/src/github.com/circleci/go-tool - #### /go/src/bitbucket.org/circleci/go-tool - working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}} + machine: true + environment: + GO_BRANCH: release-branch.go1.15 steps: + - run: echo $CIRCLE_WORKING_DIRECTORY + - run: echo $PWD + - run: echo $GOPATH + - run: echo 'export GOPATH=$HOME/go' >> $BASH_ENV + - run: echo 'export PATH="$GOPATH/bin:$PATH"' >> $BASH_ENV + - run: echo $GOPATH + - run: which go + - run: go version + - run: | + cd /usr/local + sudo mkdir go.local + sudo chown `whoami` go.local + - restore_cache: + key: go-local- + - run: | + cd /usr/local + git clone git://github.com/golang/go go.local || true + cd go.local + git fetch + git checkout "$GO_BRANCH" + [[ -x bin/go && `git rev-parse HEAD` == `cat anacrolix.built` ]] && exit + cd src + ./make.bash || exit + git rev-parse HEAD > ../anacrolix.built + - save_cache: + paths: /usr/local/go.local + key: go-local-{{ checksum "/usr/local/go.local/anacrolix.built" }} + - run: echo 'export PATH="/usr/local/go.local/bin:$PATH"' >> $BASH_ENV + - run: go version - checkout - - # specify any bash command here prefixed with `run: ` - - run: go get -v -t -d ./... - - run: go test -v ./...
\ No newline at end of file + - restore_cache: + keys: + - go-pkg- + - restore_cache: + keys: + - go-cache- + - run: go get -d ./... + - run: go test -v -race ./... -count 2 + - run: go test -bench . ./... + - save_cache: + key: go-pkg-{{ checksum "go.mod" }} + paths: + - ~/go/pkg + - save_cache: + key: go-cache-{{ .Revision }} + paths: + - ~/.cache/go-build |