|
| 1 | +# Golang CircleCI 2.0 configuration file |
| 2 | +# |
| 3 | +# Check https://circleci.com/docs/2.0/language-go/ for more details |
| 4 | +version: 2 |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + machine: true |
| 8 | + # docker: |
| 9 | + # # specify the version |
| 10 | + # - image: circleci/golang:1.11 |
| 11 | + |
| 12 | + # Specify service dependencies here if necessary |
| 13 | + # CircleCI maintains a library of pre-built images |
| 14 | + # documented at https://circleci.com/docs/2.0/circleci-images/ |
| 15 | + # - image: circleci/postgres:9.4 |
| 16 | + |
| 17 | + #### TEMPLATE_NOTE: go expects specific checkout path representing url |
| 18 | + #### expecting it in the form of |
| 19 | + #### /go/src/github.com/circleci/go-tool |
| 20 | + #### /go/src/bitbucket.org/circleci/go-tool |
| 21 | + working_directory: /home/circleci/go/src/github.com/src-d/gitbase |
| 22 | + steps: |
| 23 | + #- setup_remote_docker |
| 24 | + - checkout |
| 25 | + - run: &install |
| 26 | + name: Install dependancies |
| 27 | + command: | |
| 28 | + sudo apt-get update |
| 29 | + sudo apt-get install build-essential software-properties-common -y |
| 30 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 31 | + sudo apt-get update |
| 32 | + sudo apt-get install -y gcc g++-6 |
| 33 | + wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz |
| 34 | + sudo tar -xf go1.11.linux-amd64.tar.gz |
| 35 | + sudo rm -rf /usr/local/go |
| 36 | + sudo mv go /usr/local |
| 37 | + sudo cp /usr/local/go/bin/* /usr/bin/ |
| 38 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90 |
| 39 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90 |
| 40 | + docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd |
| 41 | + docker exec -it bblfshd bblfshctl driver install python bblfsh/python-driver |
| 42 | + docker exec -it bblfshd bblfshctl driver install php bblfsh/php-driver |
| 43 | + docker exec -it bblfshd bblfshctl driver install go bblfsh/go-driver |
| 44 | +
|
| 45 | +
|
| 46 | + # specify any bash command here prefixed with `run: ` |
| 47 | + - run: pwd |
| 48 | + - run: ls |
| 49 | + - run: go version |
| 50 | + - run: GOPATH=/home/circleci/go make test-coverage codecov |
| 51 | + test-mac: |
| 52 | + macos: |
| 53 | + xcode: "9.3.0" |
| 54 | + working_directory: ~/go/src/github.com/src-d/gitbase |
| 55 | + steps: |
| 56 | + - checkout |
| 57 | + - run: brew update |
| 58 | + - run: brew install go |
| 59 | + - run: make packages || echo "" # will fail because of docker being missing |
| 60 | + - run: if [ ! -f "build/gitbase_darwin_amd64/gitbase" ]; then echo "gitbase binary not generated" && exit 1; fi |
| 61 | + |
| 62 | +workflows: |
| 63 | + version: 2 |
| 64 | + workflow: |
| 65 | + jobs: |
| 66 | + - build |
| 67 | + - test-mac |
0 commit comments