dist: bionic sudo: required git: depth: 9999999 language: go go: - 1.11.x - 1.12.x - 1.13.x services: - docker cache: directories: - $HOME/.cache/pip - $HOME/vendor matrix: fast_finish: true stages: - test - name: deploy # require any tag name to deploy if: tag =~ .* env: - PROTOC_VERSION=3.6.0 TENSORFLOW_VERSION=1.11.0 GOPATH= before_install: - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip - unzip -d ~/.local protoc.zip && rm protoc.zip - go get -v golang.org/x/lint/golint - (wget -O - https://bootstrap.pypa.io/get-pip.py || wget -O - https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py) | sudo python3 - pip==18.1 - export PATH=~/usr/bin:.:$PATH - make --version - pip3 --version - sudo pip3 install cython - sudo pip3 install tensorflow flake8 ./python - docker run -d --privileged -p 9432:9432 --name bblfshd bblfsh/bblfshd - docker exec -it bblfshd bblfshctl driver install python bblfsh/python-driver:latest - docker exec -it bblfshd bblfshctl driver install go bblfsh/go-driver:latest - docker exec -it bblfshd bblfshctl driver install java bblfsh/java-driver:latest - 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 - sudo ldconfig install: - git clean -xfd - go env - travis_retry make TAGS=tensorflow script: - set -e - export GO111MODULE=on - test -z "$(gofmt -s -l . | grep -v vendor/)" - go vet -tags tensorflow ./... - golint -set_exit_status $(go list ./... | grep -v /vendor/) - cd python && flake8 && cd .. - go test -coverpkg=all -v -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v10/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt - # race checks increase the elapsed time by 10 minutes, we run them only in AppVeyor - hercules version - hercules --burndown --couples --devs --quiet --pb https://github.com/src-d/hercules > 1.pb - cp 1.pb 2.pb - hercules combine 1.pb 2.pb > 12.pb - (hercules generate-plugin -n MyPlug -o myplug && cd myplug && GOFLAGS="-tags=tensorflow" make) - hercules --plugin myplug/my_plug.so --help | grep my-plug - (cd contrib/_plugin_example && GOBIN=../.. make) - hercules --burndown --burndown-files --burndown-people --couples --devs --quiet https://github.com/src-d/hercules | labours -m all -o out --backend Agg --disable-projector - hercules --burndown --burndown-files --burndown-people --couples --devs --quiet --pb https://github.com/src-d/hercules | labours -f pb -m all -o out --backend Agg --disable-projector - # hercules --sentiment --quiet --languages Python https://github.com/src-d/hercules > /dev/null - set +e - if [ $TRAVIS_GO_VERSION == "1.11.x" ]; then bash <(curl -s https://codecov.io/bash); fi jobs: include: - stage: test language: generic env: DOCKER_BUILD=1 before_install: skip install: skip script: - docker build -t srcd/hercules . - docker run --rm srcd/hercules hercules --help - docker run --rm srcd/hercules labours --help - stage: deploy os: osx osx_image: xcode9.3 go: 1.12.x before_install: - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-osx-x86_64.zip - unzip -d ~/.local protoc.zip && rm protoc.zip - export PATH=.:$PATH after_success: - gzip -S .darwin_amd64.gz hercules script: skip install: - travis_retry make deploy: provider: releases api_key: secure: $GITHUB_TOKEN file: "hercules.darwin_amd64.gz" skip_cleanup: true on: tags: true - stage: deploy os: linux go: 1.13.x before_install: - wget -O protoc.zip https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip - unzip -d ~/.local protoc.zip && rm protoc.zip - export PATH=.:$PATH - (wget -O - https://bootstrap.pypa.io/get-pip.py || wget -O - https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py) | sudo python3 - pip==18.1 - sudo pip3 install twine pyopenssl script: - test v$(python3 python/setup.py --version) == $TRAVIS_TAG install: - set -e - travis_retry make - cd python - python3 setup.py bdist_wheel - cp dist/*py3-none-any* .. - cd .. after_success: - gzip -S .linux_amd64.gz hercules deploy: - provider: releases api_key: secure: $GITHUB_TOKEN file: "hercules.linux_amd64.gz" skip_cleanup: true on: tags: true - provider: script script: twine upload *py3-none-any* -u $PYPI_LOGIN -p $PYPI_PASS skip_cleanup: true on: tags: true notifications: email: false