.travis.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.v5
  12. go:
  13. - 1.10.x
  14. - 1.11.x
  15. cache:
  16. directories:
  17. - $HOME/.cache/pip
  18. - $HOME/gopath/src
  19. before_cache:
  20. - cd $HOME/gopath
  21. - rm -rf $HOME/gopath/src/gopkg.in/src-d/hercules.v5
  22. matrix:
  23. fast_finish: true
  24. allow_failures:
  25. - go: tip
  26. stages:
  27. - test
  28. - deploy
  29. env:
  30. - PROTOC_VERSION=3.6.0 TENSORFLOW_VERSION=1.8.0 GOGIT_TAG=v4.7.0
  31. before_install:
  32. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
  33. - unzip -d ~/.local protoc.zip && rm protoc.zip
  34. - go get -v github.com/golang/lint/golint
  35. - rm -rf $GOPATH/src/gopkg.in/src-d/go-git.v4
  36. - 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
  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:$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. - go vet -tags tensorflow ./...
  54. - golint -set_exit_status ./...
  55. - flake8
  56. - 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.v5/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt; fi
  57. - if [[ $TRAVIS_GO_VERSION = 1.9.* ]]; then go test -v -cpu=1,2 gopkg.in/src-d/hercules.v5/...; fi
  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.10.* ]]; then bash <(curl -s https://codecov.io/bash); fi
  69. jobs:
  70. include:
  71. - stage: test
  72. language: generic
  73. env: DOCKER_BUILD=1
  74. before_install: skip
  75. install: skip
  76. script: docker build -t srcd/hercules .
  77. - stage: deploy
  78. os: osx
  79. osx_image: xcode9.3
  80. go: 1.11.x
  81. go_import_path: gopkg.in/src-d/hercules.v5
  82. before_install:
  83. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-osx-x86_64.zip
  84. - unzip -d ~/.local protoc.zip && rm protoc.zip
  85. after_success:
  86. - gzip -S .darwin_amd64.gz $GOPATH/bin/hercules
  87. script: skip
  88. install:
  89. - DISABLE_TENSORFLOW=1 make
  90. deploy:
  91. provider: releases
  92. api_key:
  93. secure: $GITHUB_TOKEN
  94. file: "$GOPATH/bin/hercules.darwin_amd64.gz"
  95. skip_cleanup: true
  96. on:
  97. tags: true
  98. - stage: deploy
  99. os: linux
  100. go: 1.11.x
  101. go_import_path: gopkg.in/src-d/hercules.v5
  102. before_install:
  103. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
  104. - unzip -d ~/.local protoc.zip && rm protoc.zip
  105. script: skip
  106. install:
  107. - DISABLE_TENSORFLOW=1 make
  108. after_success:
  109. - gzip -S .linux_amd64.gz $GOPATH/bin/hercules
  110. deploy:
  111. provider: releases
  112. api_key:
  113. secure: $GITHUB_TOKEN
  114. file: "$GOPATH/bin/hercules.linux_amd64.gz"
  115. skip_cleanup: true
  116. on:
  117. tags: true
  118. notifications:
  119. email: false