Cache go master, use existing go for bootstrap, and tighten some cache keys

This commit is contained in:
Matt Joiner 2019-01-09 19:55:55 +11:00
parent fa4dbacd79
commit c9f4078224
1 changed files with 23 additions and 9 deletions

View File

@ -18,21 +18,35 @@ jobs:
- run: echo $GOPATH
- run: which go
- run: go version
- run: cd /usr/local && sudo rm -r go && sudo mkdir go go1.4 && sudo chown `whoami` go go1.4
- run: cd /usr/local && git clone git://github.com/golang/go
- run: cd /usr/local/go && git branch -f -t go1.4 origin/release-branch.go1.4 && cd .. && git clone --single-branch -b go1.4 go go1.4
- run: cd /usr/local/go1.4/src && ./make.bash
- run: cd /usr/local/go/src && GOROOT_BOOTSTRAP=/usr/local/go1.4 ./make.bash
- run: |
cd /usr/local
sudo mkdir go.master
sudo chown `whoami` go.master
- restore_cache:
key: go-root-
- run: |
cd /usr/local
git clone git://github.com/golang/go go.master || true
cd go.master
git pull
[[ -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.master
key: go-root-{{ checksum "/usr/local/go.master/anacrolix.built" }}
- run: echo 'export PATH="/usr/local/go.master/bin:$PATH"' >> $BASH_ENV
- run: go version
- checkout
- run: sudo apt-get update
- run: sudo apt install fuse pv
- restore_cache:
keys:
- go-pkg
- go-pkg-
- restore_cache:
keys:
- go-cache
- go-cache-
- run: go get -d ./...
- run: go test -v -race ./... -count 2
- run: go test -bench . ./...
@ -43,13 +57,13 @@ jobs:
# - run: GO111MODULE=off go install github.com/anacrolix/godo
- run: go install ./cmd/torrentfs
- save_cache:
key: go-pkg-{{ epoch }}
key: go-pkg-{{ checksum "go.mod" }}
paths:
- ~/go/pkg
- run: sudo modprobe fuse
- run: fs/test.sh
- save_cache:
key: go-cache-{{ epoch }}
key: go-cache-{{ .Revision }}
paths:
- ~/.cache/go-build
when: always