.travis.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. dist: xenial
  2. sudo: required
  3. git:
  4. depth: 9999999
  5. language: go
  6. go_import_path: gopkg.in/src-d/hercules.v10
  7. go:
  8. - 1.10.x
  9. - 1.11.x
  10. - 1.12.x
  11. services:
  12. - docker
  13. cache:
  14. directories:
  15. - $HOME/.cache/pip
  16. - $HOME/gopath/src
  17. before_cache:
  18. - cd $HOME/gopath
  19. - mv $HOME/gopath/src/gopkg.in/src-d/hercules.v10/vendor $HOME/gopath/src/gopkg.in/src-d/.vendor
  20. - rm -rf $HOME/gopath/src/gopkg.in/src-d/hercules.v10
  21. - mkdir $HOME/gopath/src/gopkg.in/src-d/hercules.v10
  22. - mv $HOME/gopath/src/gopkg.in/src-d/.vendor $HOME/gopath/src/gopkg.in/src-d/hercules.v10/vendor
  23. matrix:
  24. fast_finish: true
  25. stages:
  26. - test
  27. - name: deploy
  28. # require any tag name to deploy
  29. if: tag =~ .*
  30. env:
  31. - PROTOC_VERSION=3.6.0 TENSORFLOW_VERSION=1.11.0
  32. before_install:
  33. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
  34. - unzip -d ~/.local protoc.zip && rm protoc.zip
  35. - go get -v golang.org/x/lint/golint
  36. - go get -v github.com/golang/dep/cmd/dep
  37. - (wget -O - https://bootstrap.pypa.io/get-pip.py || wget -O - https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py) | sudo python3 - pip==18.1
  38. - export PATH=~/usr/bin:$GOPATH/bin:$PATH
  39. - make --version
  40. - pip3 --version
  41. - sudo pip3 install cython
  42. - sudo pip3 install tensorflow flake8 ./python
  43. - docker run -d --privileged -p 9432:9432 --name bblfshd bblfsh/bblfshd
  44. - docker exec -it bblfshd bblfshctl driver install python bblfsh/python-driver:latest
  45. - docker exec -it bblfshd bblfshctl driver install go bblfsh/go-driver:latest
  46. - docker exec -it bblfshd bblfshctl driver install java bblfsh/java-driver:latest
  47. - curl -L "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-$(go env GOOS)-x86_64-$TENSORFLOW_VERSION.tar.gz" | sudo tar -C /usr/local -xz
  48. - sudo ldconfig
  49. install:
  50. - git clean -xfd
  51. - travis_retry make TAGS=tensorflow
  52. script:
  53. - set -e
  54. - if [ $TRAVIS_GO_VERSION != "1.10.x" ]; then test -z "$(gofmt -s -l . | grep -v vendor/)"; fi
  55. - go vet -tags tensorflow ./...
  56. - golint -set_exit_status $(go list ./... | grep -v /vendor/)
  57. - cd python && flake8 && cd ..
  58. - go test -coverpkg=all -v -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v10/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt
  59. - # race checks increase the elapsed time by 10 minutes, we run them only in AppVeyor
  60. - $GOPATH/bin/hercules version
  61. - $GOPATH/bin/hercules --burndown --couples --devs --quiet --pb https://github.com/src-d/hercules > 1.pb
  62. - cp 1.pb 2.pb
  63. - $GOPATH/bin/hercules combine 1.pb 2.pb > 12.pb
  64. - ($GOPATH/bin/hercules generate-plugin -n MyPlug -o myplug && cd myplug && make)
  65. - (cd contrib/_plugin_example && make)
  66. - $GOPATH/bin/hercules --burndown --burndown-files --burndown-people --couples --devs --quiet https://github.com/src-d/hercules | labours -m all -o out --backend Agg --disable-projector
  67. - $GOPATH/bin/hercules --burndown --burndown-files --burndown-people --couples --devs --quiet --pb https://github.com/src-d/hercules | labours -f pb -m all -o out --backend Agg --disable-projector
  68. - # $GOPATH/bin/hercules --sentiment --quiet --languages Python https://github.com/src-d/hercules > /dev/null
  69. - set +e
  70. - if [ $TRAVIS_GO_VERSION == "1.11.x" ]; then bash <(curl -s https://codecov.io/bash); fi
  71. jobs:
  72. include:
  73. - stage: test
  74. addons: false
  75. language: generic
  76. env: DOCKER_BUILD=1
  77. before_install: skip
  78. install: skip
  79. script: docker build -t srcd/hercules .
  80. - stage: deploy
  81. os: osx
  82. osx_image: xcode9.3
  83. go: 1.12.x
  84. go_import_path: gopkg.in/src-d/hercules.v10
  85. before_install:
  86. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-osx-x86_64.zip
  87. - unzip -d ~/.local protoc.zip && rm protoc.zip
  88. - go get -v github.com/golang/dep/cmd/dep
  89. - export PATH=$GOPATH/bin:$PATH
  90. after_success:
  91. - gzip -S .darwin_amd64.gz $GOPATH/bin/hercules
  92. script: skip
  93. install:
  94. - travis_retry make
  95. deploy:
  96. provider: releases
  97. api_key:
  98. secure: $GITHUB_TOKEN
  99. file: "$GOPATH/bin/hercules.darwin_amd64.gz"
  100. skip_cleanup: true
  101. on:
  102. tags: true
  103. - stage: deploy
  104. os: linux
  105. go: 1.12.x
  106. go_import_path: gopkg.in/src-d/hercules.v10
  107. before_install:
  108. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
  109. - unzip -d ~/.local protoc.zip && rm protoc.zip
  110. - go get -v github.com/golang/dep/cmd/dep
  111. - export PATH=$GOPATH/bin:$PATH
  112. - (wget -O - https://bootstrap.pypa.io/get-pip.py || wget -O - https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py) | sudo python3 - pip==18.1
  113. - sudo pip3 install twine pyopenssl
  114. script:
  115. - test v$(python3 python/setup.py --version) == $TRAVIS_TAG
  116. install:
  117. - set -e
  118. - travis_retry make
  119. - cd python
  120. - python3 setup.py bdist_wheel
  121. - cp dist/*py3-none-any* $GOPATH/bin
  122. - cd ..
  123. after_success:
  124. - gzip -S .linux_amd64.gz $GOPATH/bin/hercules
  125. deploy:
  126. - provider: releases
  127. api_key:
  128. secure: $GITHUB_TOKEN
  129. file: "$GOPATH/bin/hercules.linux_amd64.gz"
  130. skip_cleanup: true
  131. on:
  132. tags: true
  133. - provider: script
  134. script: twine upload $GOPATH/bin/*py3-none-any* -u $PYPI_LOGIN -p $PYPI_PASS
  135. skip_cleanup: true
  136. on:
  137. tags: true
  138. notifications:
  139. email: false