forked from esl/MongooseIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
133 lines (122 loc) · 5.2 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
language: erlang
dist: trusty
sudo: required
addons:
apt:
packages:
- libpam0g-dev
- libexpat1-dev
- odbc-postgresql
- slapd
- ldap-utils
- golang # used for google drive test results upload
- unixodbc # for mssql
- tdsodbc # for mssql
hosts:
# travis tries to resolve muc.localhost and fails
# used in MUC + s2s tests combination
- muc.localhost
before_install:
# Do not execute this step, if environment variable SKIP_RELEASE is "1"
# Configure is a part of release creation
- test 1 = "$SKIP_RELEASE" || tools/configure $REL_CONFIG
# Always use git protocol for github - tiny optimization
- git config --global url."git://github".insteadOf https://github
install:
- test 1 = "$SKIP_COMPILE" || travis_retry ./rebar3 get-deps
- test 1 = "$SKIP_COMPILE" || ./rebar3 compile
## Certs are needed by some tests in small_tests
- test 1 = "$SKIP_COMPILE" || make certs
- test 1 = "$SKIP_RELEASE" || make devrel
- test 1 = "$SKIP_BUILD_TESTS" || tools/travis-build-tests.sh
- test 1 = "$SKIP_COV" || travis_retry pip install --user codecov
before_script:
- tools/travis-setup-db.sh
- if [ $PRESET = 'ldap_mnesia' ]; then sudo tools/travis-setup-ldap.sh; fi
script: KEEP_COVER_RUNNING=1 tools/travis-test.sh -p $PRESET -s $RUN_SMALL_TESTS
after_failure:
- cat `ls -1 -d -t apps/ejabberd/logs/ct_run* | head -1`/apps.ejabberd.logs/run.*/suite.log
- if [ -s _build/mim1/rel/mongooseim/log/crash.log ]; then cat _build/mim1/rel/mongooseim/log/crash.log; fi
- if [ -s _build/mim2/rel/mongooseim/log/crash.log ]; then cat _build/mim2/rel/mongooseim/log/crash.log; fi
- tail -100 _build/mim1/rel/mongooseim/log/ejabberd.log
- tail -100 _build/mim2/rel/mongooseim/log/ejabberd.log
after_success:
# env variables help to distinguish CI builds
# It takes less time without gcov
- test 1 = "$SKIP_COV" || codecov --disable=gcov --env PRESET
- test 1 = "$SKIP_COV" || ./rebar3 coveralls send
- if [ -n "${DOCKERHUB_PASS}" ] && [ $PRESET = 'internal_mnesia' ] && [ $TRAVIS_OTP_RELEASE = "19.3" ];
then tools/travis-build-and-push-docker.sh;
fi
after_script:
# Upload logs to s3 for debugging
- test 1 = "$SKIP_REPORT_UPLOAD" ||
tools/travis-prepare-log-dir.sh
- test 1 = "$SKIP_REPORT_UPLOAD" ||
if [ -n "${AWS_SECRET_ACCESS_KEY}" ]; then tools/travis-upload-to-s3.sh; fi
- test 1 = "$SKIP_REPORT_UPLOAD" ||
tools/travis-publish-github-comment.sh
- test 1 = "$SKIP_REPORT_UPLOAD" ||
if [ -n "${GDRIVE_SERVICE_ACCOUNT_CREDENTIALS}" ]; then tools/travis-upload-to-gdrive.sh; fi
- test 1 = "$SKIP_REPORT_UPLOAD" ||
tools/travis-secure-erase.sh /tmp/serviceAccountCredentials
services:
- redis-server
- docker
branches:
only:
- master
- stable
- /^rel\-\d+\.\d+$/
- /^\d+\.\d+\.\d+([a-z0-9\-\+])*/
otp_release:
- 19.3
env:
global:
- RUN_SMALL_TESTS=false
matrix:
- PRESET=small_tests RUN_SMALL_TESTS=true SKIP_RELEASE=1 SKIP_BUILD_TESTS=1
- PRESET=internal_mnesia DB=mnesia REL_CONFIG=with-all TLS_DIST=yes
- PRESET=mysql_redis DB=mysql REL_CONFIG="with-mysql with-redis"
- PRESET=odbc_mssql_mnesia DB=mssql REL_CONFIG=with-odbc
- PRESET=ldap_mnesia DB=mnesia REL_CONFIG=with-none
- PRESET=elasticsearch_and_cassandra_mnesia DB="elasticsearch cassandra"
REL_CONFIG="with-elasticsearch with-cassandra" TESTSPEC=mam.spec
ELASTICSEARCH_VERSION=5.6.9 CASSANDRA_VERSION=3.9
# In case you want to test with another ODBC driver, uncomment this
# - PRESET=odbc_pgsql_mnesia DB=pgsql REL_CONFIG=with-odbc
matrix:
include:
- otp_release: 20.0
env: PRESET=dialyzer_only
SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 SKIP_COV=1 SKIP_REPORT_UPLOAD=1
- otp_release: 20.0
env: PRESET=pgsql_mnesia DB=pgsql REL_CONFIG="with-pgsql with-jingle-sip"
RUN_SMALL_TESTS=true
- otp_release: 21.0
env: PRESET=riak_mnesia DB=riak REL_CONFIG="with-riak with-jingle-sip" RUN_SMALL_TESTS=true
- language: generic
env: PRESET=pkg pkg_PLATFORM=centos7
SKIP_COMPILE=1 SKIP_RELEASE=1 SKIP_BUILD_TESTS=1
SKIP_COV=1 SKIP_REPORT_UPLOAD=1
- language: generic
env: PRESET=pkg pkg_PLATFORM=debian_stretch
SKIP_COMPILE=1 SKIP_RELEASE=1 SKIP_BUILD_TESTS=1
SKIP_COV=1 SKIP_REPORT_UPLOAD=1
notifications:
webhooks:
# trigger Buildtime Trend Service to parse Travis CI log
- https://buildtimetrend.herokuapp.com/travis
- https://tide.erlang-solutions.com/api/travis_ci/events
on_start: always
cache:
directories:
- $HOME/.cache/rebar3
deploy:
provider: releases
api-key: $GITHUB_TOKEN
skip_cleanup: true
file: mongooseim-$TRAVIS_BRANCH.OTP-$TRAVIS_OTP_RELEASE.$(lsb_release -is | tr "A-Z" "a-z").$(lsb_release -rs).$(uname -m).tar.bz2
on:
tags: true
condition: "$PRESET.$TRAVIS_OTP_RELEASE = internal_mnesia.18.3"