-
Notifications
You must be signed in to change notification settings - Fork 36
/
.travis.yml
144 lines (135 loc) · 4.13 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
144
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
- /^dummy-v\d+\.\d+(\.\d+)?(-\S*)?$/
language: go
sudo: required
services:
- docker
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
# workaround for https://github.com/smola/ci-tricks/issues/19
- rabbitmq-server
go:
- '1.12.x'
before_install:
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
- . $HOME/.nvm/nvm.sh
- nvm install 8
- nvm use 8
- npm install -g yarn
stages:
- name: tests
- name: release
if: tag IS present AND NOT tag =~ /^dummy/
- name: release dummy analyzer
if: tag IS present AND tag =~ /^dummy/
- name: deploy staging
if: branch = master AND type = push
jobs:
include:
- name: 'Unit Tests'
stage: tests
script: make test-coverage codecov
- name: 'SDK Integration Tests Linux'
script:
- make ci-start-bblfsh
- make test-sdk
- name: 'SDK Integration Tests macOS'
if: NOT type = pull_request
script:
- make test-sdk-short
os: osx
osx_image: xcode10.1
before_install: skip
- name: 'Lookoutd Integration Tests Linux'
script:
- make ci-integration-dependencies
- psql -c 'create database lookout;' -U postgres
- make test-json
- LOOKOUT_TEST_QUEUE=true make test-json
- name: 'Lookoutd Integration Tests macOS'
if: NOT type = pull_request
script:
- make ci-integration-dependencies
- psql -c 'create database lookout;' -U postgres
- make test-json
- LOOKOUT_TEST_QUEUE=true make test-json
os: osx
osx_image: xcode10.1
before_install: skip
- name: 'Web Tests'
stage: tests
script:
- make dependencies
- make -f Makefile.web build
- make -f Makefile.web test
- make -f Makefile.web lint
- name: 'Generated code'
script:
- make dependencies
- go generate ./...
- make no-changes-in-commit
- kallax migrate --input ./store/models/ --out ./store/migrations --name test-changes
- make no-changes-in-commit
- make pack-migrations
- make no-changes-in-commit
- make build
- make no-changes-in-commit
- make godep
- make no-changes-in-commit
- name: 'linux packages'
stage: release
script:
- PKG_OS="linux" make packages
- PKG_OS="linux" make -f Makefile.sdk packages
- PKG_OS="linux" make -f Makefile.dummy packages
deploy: &deploy_anchor
provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: build/*.tar.gz
skip_cleanup: true
on:
all_branches: true
- name: 'macOS packages'
stage: release
os: osx
osx_image: xcode10.1
before_install: skip
script:
- PKG_OS="darwin" make packages
- PKG_OS="darwin" make -f Makefile.sdk packages
- PKG_OS="darwin" make -f Makefile.dummy packages
deploy: *deploy_anchor
- name: 'push image to Docker Hub'
stage: release
script:
- PKG_OS=linux make build
- make docker-push-latest-release
- name: 'push dummy analyzer image to Docker Hub'
stage: release dummy analyzer
script:
- PKG_OS=linux make -f Makefile.dummy build
- DOCKER_PUSH_LATEST=true make -f Makefile.dummy docker-push
- name: 'push staging deploy image to DockerHub'
stage: deploy staging
script:
- make dependencies
- PKG_OS=linux DOCKER_OS=linux DOCKER_ARCH=amd64 make packages
- make docker-push
- HELM_RELEASE=lookout HELM_CHART=lookout K8S_NAMESPACE=lookout HELM_ARGS="--namespace lookout --tiller-namespace lookout --repo https://src-d.github.io/charts/stable/ --set image.lookout.tag=dev-${TRAVIS_COMMIT:0:7} --version 0.9.1 -f .helm-staging.yml" make deploy
before_cache:
# make bblfsh images readable
- sudo chmod -R 777 $HOME/bblfshd/images
cache:
directories:
- $HOME/.cache/pip/wheels
- $HOME/bblfshd/images