-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
139 lines (126 loc) · 3.96 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
language: cpp
## Enable cache for dependencies and directories
cache:
directories:
- $CACHE_DIR
## Operating Systems to use for builds
os:
- linux
## Ensures the virtualization environment runs as Ubuntu 14.04 Trusty
dist: bionic
## Environment variables
#
# The 'global' section defines variables common for all jobs
env:
global:
- COMPILER_VERSION=
- DIST_NAME=ubuntu
- DIST_VERSION=bionic
- DOCKER_CXX=g++
- DOCKER_CC=gcc
- DOCKER_COMPOSE_VERSION=1.16.1
- DRIZZLE_TEST_EXIT_ERROR_ON_SKIP=0
- MAKE_TARGET=check
- MYSQL_PASSWORD=''
- MYSQL_PORT=3306
- MYSQL_SERVER=127.0.0.1
- MYSQL_USER=root
- PATH="$(git config -f .gitmodules submodule.beaver.path)/bin:$PATH"
- SKIP_TEST_ON_ERROR=0
- CACHE_DIR=build/travis-cache
- CONFIGURE_ARGS=
## Build steps for all jobs
## Install dependencies
before_install:
- ./travis_configure.sh before_install
## Prepare build system for tests
before_script:
- ./travis_configure.sh before_script
## Run tests, and packaging scripts
script:
- ./travis_configure.sh run_tests
after_success:
- beaver/bin/codecov-bash -X gcov -Z -s build
## Defines the order of the build stages.
#
# The deployment stage is only done is building semver git tag
stages:
- test
- deploy
## Defines the jobs to run in each stage
#
# Travis combines the variables defined in env.global with the variables
# defined for each job
#
# The resulting build matrix is as follows:
#
# | os | dist | compiler | make targets | deploy |
# |--------|--------|-----------|--------------|--------|
# | linux | ubuntu | clang | check | no |
# | linux | ubuntu | gcc | check deb | yes |
# | linux | centos | gcc | check rpm | yes |
# | osx | sierra | clang¹ | check | no |
#
# Linux based builds are run in docker containers using docker-compose.
#
# OSX based builds are done by a third-party provider
#
# ¹ The compiler reported is the Apple LLVM version
templates:
# Global config for builds on linux
_linux-build: &linux-build
services:
- docker
# Global config for builds on osx
_osx-build: &osx-build
os: osx
compiler: clang
# Enable the build condition if travis' osx service startup hangs
# if: tag =~ osx$ OR branch =~ osx$
# Global config for deployment stage
_deploy: &deploy
stage: deploy
os: linux
after_success: skip
before_script: skip
if: tag IS present AND tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+
script:
- beaver bintray upload -D $DIST_VERSION -N $CACHE_DIR/*.deb
jobs:
fast_finish: true
include:
# Sets up the build environment, compiles the code and runs tests
- <<: *linux-build
env:
MAKE_TARGET=$MAKE_TARGET:deb:api-sanity-checker
before_cache:
- if [[ -n "$TRAVIS_TAG" ]]; then cp build/pkg/deb/*.deb $CACHE_DIR/; fi
- <<: *linux-build
env:
DIST_VERSION=bionic MAKE_TARGET=$MAKE_TARGET:deb:api-sanity-checker
before_cache:
- if [[ -n "$TRAVIS_TAG" ]]; then cp build/pkg/deb/*.deb $CACHE_DIR/; fi
- <<: *linux-build
env:
MAKE_TARGET=$MAKE_TARGET:check-code-coverage
CONFIGURE_ARGS="$CONFIGURE_ARGS --with-coverage-support=capture"
- <<: *linux-build
env:
DOCKER_CXX=clang++ DOCKER_CC=clang COMPILER_VERSION=4.0
- <<: *linux-build
env:
DIST_NAME=centos DIST_VERSION=8 MAKE_TARGET=$MAKE_TARGET:rpm
- <<: *osx-build
env:
DIST_NAME=osx MAKE_TARGET=check DRIZZLE_MYSQL_CA_PATH=/usr/local/var/mysql/
## Deployment stage
- <<: *deploy
# Deploy deb packages to bintray. Doesn't build the packages but uses the
# cache from the first stage.
# Note that the 'env' section must be identical to the build in stage 1
# which caches the generated deb package
env:
MAKE_TARGET=$MAKE_TARGET:deb:api-sanity-checker
- <<: *deploy
env:
DIST_VERSION=bionic MAKE_TARGET=$MAKE_TARGET:deb:api-sanity-checker