2017-08-27 00:10:17 +08:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
2017-08-29 12:02:30 +08:00
|
|
|
machine: true
|
|
|
|
environment:
|
2018-07-25 16:57:49 +08:00
|
|
|
# PROJECT_GO_PACKAGE: github.com/anacrolix/torrent
|
2017-08-29 12:02:30 +08:00
|
|
|
# Should use PROJECT_GO_PACKAGE here but it's not interpolated for this
|
|
|
|
# field. https://discuss.circleci.com/t/environment-variable-expansion-in-
|
|
|
|
# working-directory/11322/4
|
2018-07-25 16:57:49 +08:00
|
|
|
# working_directory: ~/go/src/github.com/anacrolix/torrent
|
2017-08-27 00:10:17 +08:00
|
|
|
steps:
|
2018-07-25 16:57:49 +08:00
|
|
|
# - run: echo $PROJECT_GO_PACKAGE
|
2017-08-29 12:02:30 +08:00
|
|
|
- run: echo $CIRCLE_WORKING_DIRECTORY
|
|
|
|
- run: echo $PWD
|
2019-01-08 13:37:40 +08:00
|
|
|
- run: echo $GOPATH
|
2017-08-29 12:02:30 +08:00
|
|
|
- run: echo 'export GOPATH=$HOME/go' >> $BASH_ENV
|
|
|
|
- run: echo 'export PATH="$GOPATH/bin:$PATH"' >> $BASH_ENV
|
|
|
|
- run: echo $GOPATH
|
2019-01-08 13:37:40 +08:00
|
|
|
- run: which go
|
2017-08-29 12:02:30 +08:00
|
|
|
- run: go version
|
|
|
|
- run: cd /usr/local && sudo rm -r go && sudo mkdir go go1.4 && sudo chown `whoami` go go1.4 && git clone git://github.com/golang/go && cd go && git branch -f -t go1.4 origin/release-branch.go1.4 && cd .. && git clone --single-branch -b go1.4 go go1.4 && cd go1.4/src && ./make.bash && cd ../../go/src && GOROOT_BOOTSTRAP=/usr/local/go1.4 ./make.bash
|
|
|
|
- run: go version
|
2017-08-27 00:10:17 +08:00
|
|
|
- checkout
|
2017-10-12 13:32:11 +08:00
|
|
|
- run: sudo apt-get update
|
2017-08-29 12:02:30 +08:00
|
|
|
- run: sudo apt install fuse pv
|
2019-01-08 13:31:26 +08:00
|
|
|
- run: go get ./...
|
2018-07-25 16:57:49 +08:00
|
|
|
- run: go test -v -race ./... -count 2
|
|
|
|
- run: go test -bench . ./...
|
|
|
|
# - run: CGO_ENABLED=0 go get -t -d -v $PROJECT_GO_PACKAGE/...
|
|
|
|
- run: set +e; CGO_ENABLED=0 go test -v ./...; true
|
2018-07-25 17:10:08 +08:00
|
|
|
- run: go install golang.org/x/mobile/cmd/gomobile
|
2017-08-27 00:10:17 +08:00
|
|
|
- run: gomobile init
|
|
|
|
- run: gomobile build -target=android $PROJECT_GO_PACKAGE
|
2018-07-25 18:34:19 +08:00
|
|
|
# - run: GO111MODULE=off go install github.com/anacrolix/godo
|
2018-07-27 08:44:26 +08:00
|
|
|
- run: go install ./cmd/torrentfs
|
2017-08-29 12:02:30 +08:00
|
|
|
- run: sudo modprobe fuse
|
|
|
|
- run: fs/test.sh
|