forked from src-d/hercules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
141 lines (130 loc) · 4.97 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
dist: xenial
sudo: required
git:
depth: 9999999
language: go
go_import_path: gopkg.in/src-d/hercules.v7
go:
- 1.10.x
- 1.11.x
services:
- docker
addons:
apt:
packages:
- libxml2-dev
cache:
directories:
- $HOME/.cache/pip
- $HOME/gopath/src
before_cache:
- cd $HOME/gopath
- mv $HOME/gopath/src/gopkg.in/src-d/hercules.v7/vendor $HOME/gopath/src/gopkg.in/src-d/.vendor
- rm -rf $HOME/gopath/src/gopkg.in/src-d/hercules.v7
- mkdir $HOME/gopath/src/gopkg.in/src-d/hercules.v7
- mv $HOME/gopath/src/gopkg.in/src-d/.vendor $HOME/gopath/src/gopkg.in/src-d/hercules.v7/vendor
matrix:
fast_finish: true
allow_failures:
- go: tip
stages:
- test
- name: deploy
# require any tag name to deploy
if: tag =~ .*
env:
- PROTOC_VERSION=3.6.0 TENSORFLOW_VERSION=1.11.0
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
- go get -v github.com/golang/dep/cmd/dep
- (wget -O - https://bootstrap.pypa.io/get-pip.py || wget -O - https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py) | python3 - --user pip==18.1
- export PATH=~/usr/bin:$GOPATH/bin:$PATH
- make --version
- pip3 --version
- pip3 install --user cython
- pip3 install --user --no-build-isolation -r requirements.txt tensorflow flake8
- 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
- make TAGS=tensorflow
script:
- set -e
- if [ $TRAVIS_GO_VERSION == "1.11.x" ]; then test -z "$(gofmt -s -l . | grep -v vendor/)"; fi
- go vet -tags tensorflow ./...
- golint -set_exit_status $(go list ./... | grep -v /vendor/)
- flake8
- go test -coverpkg=all -v -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/hercules.v7/... && sed -i '/cmd\/hercules\|core.go/d' coverage.txt
- $GOPATH/bin/hercules version
- $GOPATH/bin/hercules --burndown --couples --devs --quiet --pb https://github.com/src-d/hercules > 1.pb
- cp 1.pb 2.pb
- $GOPATH/bin/hercules combine 1.pb 2.pb > 12.pb
- ($GOPATH/bin/hercules generate-plugin -n MyPlug -o myplug && cd myplug && make)
- (cd contrib/_plugin_example && make)
- $GOPATH/bin/hercules --burndown --burndown-files --burndown-people --couples --devs --quiet https://github.com/src-d/hercules | python3 labours.py -m all -o out --backend Agg --disable-projector
- $GOPATH/bin/hercules --burndown --burndown-files --burndown-people --couples --devs --quiet --pb https://github.com/src-d/hercules | python3 labours.py -f pb -m all -o out --backend Agg --disable-projector
- # $GOPATH/bin/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
addons: false
language: generic
env: DOCKER_BUILD=1
before_install: skip
install: skip
script: docker build -t srcd/hercules .
- stage: deploy
os: osx
osx_image: xcode9.3
go: 1.11.x
go_import_path: gopkg.in/src-d/hercules.v7
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
- go get -v github.com/golang/dep/cmd/dep
- export PATH=$GOPATH/bin:$PATH
after_success:
- gzip -S .darwin_amd64.gz $GOPATH/bin/hercules
script: skip
install:
- make
deploy:
provider: releases
api_key:
secure: $GITHUB_TOKEN
file: "$GOPATH/bin/hercules.darwin_amd64.gz"
skip_cleanup: true
on:
tags: true
- stage: deploy
os: linux
go: 1.11.x
go_import_path: gopkg.in/src-d/hercules.v7
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 github.com/golang/dep/cmd/dep
- export PATH=$GOPATH/bin:$PATH
script: skip
install:
- make
after_success:
- gzip -S .linux_amd64.gz $GOPATH/bin/hercules
deploy:
provider: releases
api_key:
secure: $GITHUB_TOKEN
file: "$GOPATH/bin/hercules.linux_amd64.gz"
skip_cleanup: true
on:
tags: true
notifications:
email: false