torrent/.circleci/config.yml

61 lines
1.8 KiB
YAML

version: 2
jobs:
build:
machine: true
environment:
GO_BRANCH: release-branch.go1.12
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
- run: sudo apt-get update
- run: sudo apt install fuse pv
- 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 . ./...
- run: set +e; CGO_ENABLED=0 go test -v ./...; true
- run: go install ./cmd/torrentfs
- save_cache:
key: go-pkg-{{ checksum "go.mod" }}
paths:
- ~/go/pkg
- run: sudo modprobe fuse
- run: fs/test.sh
- save_cache:
key: go-cache-{{ .Revision }}
paths:
- ~/.cache/go-build