forked from esl/MongooseIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
138 lines (126 loc) · 5.77 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
language: erlang
dist: xenial
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:
- nohup ./tools/travis-pull-db.sh > travis-pull-db.log 2>&1 < /dev/null &
# 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:
# Make full build for Cron builds
- test cron = "$TRAVIS_EVENT_TYPE" -o 1 = "$SKIP_COMPILE" || ./tools/cache-build.sh restore
- test cron = "$TRAVIS_EVENT_TYPE" -o 1 = "$SKIP_BUILD_TESTS" || ./tools/cache-tests.sh restore
- test cron = "$TRAVIS_EVENT_TYPE" -o 1 = "$SKIP_COMPILE" || ./tools/cache-certs.sh restore
- test 1 = "$SKIP_COMPILE" || travis_retry ./rebar3 get-deps
## Certs are needed by some tests in small_tests
- test 1 = "$SKIP_COMPILE" || make certs
- test 1 = "$SKIP_RELEASE" || ./tools/build-releases.sh
- test 1 = "$SKIP_BUILD_TESTS" || tools/travis-build-tests.sh
- test 1 = "$SKIP_COV" || travis_retry pip install --user codecov
# Update cache if needed and if build step succeded.
- test 1 = "$SKIP_COMPILE" || ./tools/cache-build.sh store
- test 1 = "$SKIP_BUILD_TESTS" || ./tools/cache-tests.sh store
- test 1 = "$SKIP_COMPILE" || ./tools/cache-certs.sh store
- test 1 = "$SKIP_REPORT_UPLOAD" ||
if [ -n "${GDRIVE_SERVICE_ACCOUNT_CREDENTIALS}" ]; then JUST_INSTALL=1 tools/travis-upload-to-gdrive.sh; fi
before_script:
- tools/travis-setup-db.sh
- if [ $PRESET = 'ldap_mnesia' ]; then sudo tools/travis-setup-ldap.sh; fi
- if [ $PRESET = 'mysql_redis' ]; then sudo tools/travis-setup-rmq.sh; fi
script:
- SKIP_AUTO_COMPILE=true 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_script:
- cat travis-pull-db.log
# 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
- /^rel\-\d+\.\d+$/
- /^\d+\.\d+\.\d+([a-z0-9\-\+])*/
otp_release:
- 22.0
env:
global:
- RUN_SMALL_TESTS=false
matrix:
# When changing jobs, update EXAMPLES in tools/test-runner.sh
- 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=true
- PRESET=odbc_mssql_mnesia DB=mssql REL_CONFIG="with-odbc"
- PRESET=mysql_redis DB=mysql REL_CONFIG="with-mysql with-redis with-amqp_client"
- PRESET=riak_mnesia DB=riak REL_CONFIG="with-riak"
- 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
- PRESET=dialyzer_only SKIP_RELEASE=1 SKIP_BUILD_TESTS=1 SKIP_COV=1 SKIP_REPORT_UPLOAD=1
# 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: 21.3
env: PRESET=pgsql_mnesia DB=pgsql REL_CONFIG="with-pgsql" 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
on_start: always
cache:
directories:
- $HOME/.cache/rebar3
- $HOME/.cache/mim_builds
- $HOME/.cache/mim_tests
- $HOME/.cache/mim_certs
- /tmp/go/bin
# 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"