.travis.yml 5.1 KB

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