.travis.yml 5.0 KB

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