]> Sergey Matveev's repositories - btrtrc.git/blob - .circleci/config.yml
Remove gomobile from CI
[btrtrc.git] / .circleci / config.yml
1 version: 2
2 jobs:
3   build:
4     machine: true
5     environment:
6       # PROJECT_GO_PACKAGE: github.com/anacrolix/torrent
7     # Should use PROJECT_GO_PACKAGE here but it's not interpolated for this
8     # field. https://discuss.circleci.com/t/environment-variable-expansion-in-
9     # working-directory/11322/4
10     # working_directory: ~/go/src/github.com/anacrolix/torrent
11     steps:
12       # - run: echo $PROJECT_GO_PACKAGE
13       - run: echo $CIRCLE_WORKING_DIRECTORY
14       - run: echo $PWD
15       - run: echo $GOPATH
16       - run: echo 'export GOPATH=$HOME/go' >> $BASH_ENV
17       - run: echo 'export PATH="$GOPATH/bin:$PATH"' >> $BASH_ENV
18       - run: echo $GOPATH
19       - run: which go
20       - run: go version
21       - run: |
22           cd /usr/local
23           sudo mkdir go.master
24           sudo chown `whoami` go.master
25       - restore_cache:
26           key: go-root-
27       - run: |
28           cd /usr/local
29           git clone git://github.com/golang/go go.master || true
30           cd go.master
31           git pull
32           [[ -x bin/go && `git rev-parse HEAD` == `cat anacrolix.built` ]] && exit
33           cd src
34           ./make.bash || exit
35           git rev-parse HEAD > ../anacrolix.built
36       - save_cache:
37           paths: /usr/local/go.master
38           key: go-root-{{ checksum "/usr/local/go.master/anacrolix.built" }}
39       - run: echo 'export PATH="/usr/local/go.master/bin:$PATH"' >> $BASH_ENV
40       - run: go version
41       - checkout
42       - run: sudo apt-get update
43       - run: sudo apt install fuse pv
44       - restore_cache:
45           keys:
46             - go-pkg-
47       - restore_cache:
48           keys:
49             - go-cache-
50       - run: go get -d ./...
51       - run: go test -v -race ./... -count 2
52       - run: go test -bench . ./...
53       - run: set +e; CGO_ENABLED=0 go test -v ./...; true
54       - run: go install ./cmd/torrentfs
55       - save_cache:
56           key: go-pkg-{{ checksum "go.mod" }}
57           paths:
58             - ~/go/pkg
59       - run: sudo modprobe fuse
60       - run: fs/test.sh
61       - save_cache:
62           key: go-cache-{{ .Revision }}
63           paths:
64             - ~/.cache/go-build
65           when: always