.travis.yml 4.2 KB

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