.travis.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.v3
  16. go:
  17. - 1.9.x
  18. - 1.10.x
  19. - tip
  20. matrix:
  21. fast_finish: true
  22. allow_failures:
  23. - go: tip
  24. stages:
  25. - test
  26. - deploy
  27. env:
  28. - PROTOC_VERSION=3.5.1 TENSORFLOW_VERSION=1.7.0
  29. before_install:
  30. - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
  31. - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
  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. - git clone --depth 1 https://github.com/src-d/go-git $GOPATH/src/gopkg.in/src-d/go-git.v4
  36. - wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py --user && rm get-pip.py
  37. - export PATH=~/usr/bin:$PATH
  38. - make --version
  39. - pip3 --version
  40. - pip3 install --user --no-build-isolation -r requirements.txt tensorflow
  41. - docker run -d --privileged -p 9432:9432 --name bblfshd bblfsh/bblfshd
  42. - docker exec -it bblfshd bblfshctl driver install --all
  43. - 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
  44. - sudo ldconfig
  45. install:
  46. - make
  47. script:
  48. - set -e
  49. - go vet -tags tensorflow ./...
  50. - golint -set_exit_status ./...
  51. - go test -tags tensorflow -v -cpu=1,2 -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v3
  52. - $GOPATH/bin/hercules version
  53. - $GOPATH/bin/hercules --burndown --couples --quiet --pb https://github.com/src-d/hercules > 1.pb
  54. - cp 1.pb 2.pb
  55. - $GOPATH/bin/hercules combine 1.pb 2.pb > 12.pb
  56. - ($GOPATH/bin/hercules generate-plugin -n MyPlug -o myplug && cd myplug && make)
  57. - (cd contrib/_plugin_example && make)
  58. - $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
  59. - $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
  60. - $GOPATH/bin/hercules --sentiment --quiet --languages Python https://github.com/src-d/hercules
  61. - set +e
  62. after_success:
  63. - bash <(curl -s https://codecov.io/bash)
  64. jobs:
  65. include:
  66. - stage: deploy
  67. os: osx
  68. osx_image: xcode9.3
  69. go: 1.10.x
  70. before_install:
  71. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-osx-x86_64.zip
  72. - unzip -d ~/.local protoc.zip && rm protoc.zip
  73. after_success:
  74. - gzip -S .darwin_amd64.gz $GOPATH/bin/hercules
  75. script: skip
  76. install:
  77. - DISABLE_TENSORFLOW=1 make
  78. deploy:
  79. provider: releases
  80. api_key:
  81. secure: $GITHUB_TOKEN
  82. file: "$GOPATH/bin/hercules.darwin_amd64.gz"
  83. skip_cleanup: true
  84. on:
  85. tags: true
  86. - stage: deploy
  87. os: linux
  88. go: 1.10.x
  89. before_install:
  90. - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
  91. - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
  92. - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
  93. - unzip -d ~/.local protoc.zip && rm protoc.zip
  94. - 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
  95. - sudo ldconfig
  96. script: skip
  97. install:
  98. - make
  99. after_success:
  100. - gzip -S .linux_amd64.gz $GOPATH/bin/hercules
  101. deploy:
  102. provider: releases
  103. api_key:
  104. secure: $GITHUB_TOKEN
  105. file: "$GOPATH/bin/hercules.linux_amd64.gz"
  106. skip_cleanup: true
  107. on:
  108. tags: true
  109. notifications:
  110. email: false