.travis.yml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. - $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 | python3 labours.py -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 | python3 labours.py -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.11.x
  84. go_import_path: gopkg.in/src-d/hercules.v9
  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.11.x
  106. go_import_path: gopkg.in/src-d/hercules.v9
  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. script: skip
  113. install:
  114. - travis_retry make
  115. after_success:
  116. - gzip -S .linux_amd64.gz $GOPATH/bin/hercules
  117. deploy:
  118. provider: releases
  119. api_key:
  120. secure: $GITHUB_TOKEN
  121. file: "$GOPATH/bin/hercules.linux_amd64.gz"
  122. skip_cleanup: true
  123. on:
  124. tags: true
  125. notifications:
  126. email: false