.travis.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. dist: trusty
  2. git:
  3. depth: 9999999
  4. language: go
  5. services:
  6. - docker
  7. addons:
  8. apt:
  9. sources:
  10. - ubuntu-toolchain-r-test
  11. packages:
  12. - libxml2-dev
  13. - gcc-6
  14. - g++-6
  15. go_import_path: gopkg.in/src-d/hercules.v4
  16. go:
  17. - 1.9.x
  18. - 1.10.x
  19. - tip
  20. cache:
  21. directories:
  22. - $HOME/.cache/pip
  23. - $HOME/gopath/src
  24. before_cache:
  25. - cd $HOME/gopath
  26. - rm -rf $HOME/gopath/src/gopkg.in/src-d/hercules.v4
  27. matrix:
  28. fast_finish: true
  29. allow_failures:
  30. - go: tip
  31. stages:
  32. - test
  33. - deploy
  34. env:
  35. - PROTOC_VERSION=3.6.0 TENSORFLOW_VERSION=1.8.0
  36. before_install:
  37. - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
  38. - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
  39. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
  40. - unzip -d ~/.local protoc.zip && rm protoc.zip
  41. - go get -v github.com/golang/lint/golint
  42. - rm -rf $GOPATH/src/gopkg.in/src-d/go-git.v4
  43. - git clone --depth 1 https://github.com/src-d/go-git $GOPATH/src/gopkg.in/src-d/go-git.v4
  44. - wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py --user && rm get-pip.py
  45. - export PATH=~/usr/bin:$PATH
  46. - make --version
  47. - pip3 --version
  48. - pip3 install --user --no-build-isolation -r requirements.txt tensorflow
  49. - docker run -d --privileged -p 9432:9432 --name bblfshd bblfsh/bblfshd
  50. - docker exec -it bblfshd bblfshctl driver install python bblfsh/python-driver:latest
  51. - docker exec -it bblfshd bblfshctl driver install go bblfsh/go-driver:latest
  52. - docker exec -it bblfshd bblfshctl driver install java bblfsh/java-driver:latest
  53. - 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
  54. - sudo ldconfig
  55. install:
  56. - git clean -xfd
  57. - make
  58. script:
  59. - set -e
  60. - go vet -tags tensorflow ./...
  61. - golint -set_exit_status ./...
  62. - if [[ $TRAVIS_GO_VERSION != 1.9.* ]]; then go test -coverpkg=all -v -cpu=1,2 -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v4/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt; fi
  63. - if [[ $TRAVIS_GO_VERSION = 1.9.* ]]; then go test -v -cpu=1,2 gopkg.in/src-d/hercules.v4/...; fi
  64. - $GOPATH/bin/hercules version
  65. - $GOPATH/bin/hercules --burndown --couples --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 --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 --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
  73. - set +e
  74. after_success:
  75. - bash <(curl -s https://codecov.io/bash)
  76. jobs:
  77. include:
  78. - stage: deploy
  79. os: osx
  80. osx_image: xcode9.3
  81. go: 1.10.x
  82. go_import_path: gopkg.in/src-d/hercules.v4
  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. after_success:
  87. - gzip -S .darwin_amd64.gz $GOPATH/bin/hercules
  88. script: skip
  89. install:
  90. - DISABLE_TENSORFLOW=1 make
  91. deploy:
  92. provider: releases
  93. api_key:
  94. secure: $GITHUB_TOKEN
  95. file: "$GOPATH/bin/hercules.darwin_amd64.gz"
  96. skip_cleanup: true
  97. on:
  98. tags: true
  99. - stage: deploy
  100. os: linux
  101. go: 1.10.x
  102. go_import_path: gopkg.in/src-d/hercules.v4
  103. before_install:
  104. - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
  105. - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
  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. script: skip
  109. install:
  110. - DISABLE_TENSORFLOW=1 make
  111. after_success:
  112. - gzip -S .linux_amd64.gz $GOPATH/bin/hercules
  113. deploy:
  114. provider: releases
  115. api_key:
  116. secure: $GITHUB_TOKEN
  117. file: "$GOPATH/bin/hercules.linux_amd64.gz"
  118. skip_cleanup: true
  119. on:
  120. tags: true
  121. notifications:
  122. email: false