.travis.yml 4.6 KB

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