.travis.yml 4.4 KB

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