-
Notifications
You must be signed in to change notification settings - Fork 313
/
.travis.yml
143 lines (132 loc) · 4.98 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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