.travis.yml 4.9 KB

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