-
Notifications
You must be signed in to change notification settings - Fork 115
/
.travis.yml
executable file
·145 lines (132 loc) · 6.54 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
145
# errata:
# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback]
# IPv6 support
sudo: required
dist: bionic
os: linux
language: minimal
services:
- docker
cache:
ccache: true
directories:
- $HOME/cache
env:
global:
# DOCKER_HUB_USER
- secure: "aRGy3uOirhSKdaKKIoHhdyHwRoIo2WGKNt3SFv7oRyMbafPZylsg7L2Eo7iKRXNT8RmCo5ObpxzfYZo0UJM55ruZUPTAZfUhBTvbfF8a6ZEP7ZS5qGJFc5yLamoZ/Ov4XlAtCJ/mKHQ0a4ekY/qNzg8qNf2B1nwaogIKkDZTiOroSCL7uNntxzQIVt9V3PyE0GdapAjUHMr9IPDzGmRFxcekX36ZbS/vWF5fmWFbNHKnyavMijADS4WjUsjX2SSXUdbaS9sy6XCtjydvlNZYBxgtg/1L7Fe6HtzMS0++2t2xV1Fma6xamcywg2n+6mP8aWLO3wu/tkQdz1mu7XQRYJFxNoeHzGGyY8D2zI9RqDwSpsE4hjZSwycKTvJ3GFGiUaKMeDdbCaHdaqSKiFvKWXr4pgPm2PFk0QRML/sg7srmB7bt5veGQighgT0YdOcSTmSclFuSikMs1xi1EBsK60LSZoQ1f5DlLuglMSnnBX9KN23g/qv3TnvlX/6VeppaqLLsvfkmAxUgMFZlza0uJLwYPiEMc7qy7elCZb+6Yk1pxBJeevQpFcrbkwf5uOz3Gsaj6Kx+yaIcB+Tut0sDWIWR3ZTVny/iFl5PwMYf85lgMSPkJwNeq3bqC5ai0Wu4fd4EL2l3A+XMN5lryltxxswH/lApxX7OTrxIwRbkN9E="
# DOCKER_HUB_PASSWORD
- secure: "UvMCRP3e4tkWgmTS+W7wj2ZZ07MdlP6/fL+wbQkKQE6sFJwx/wxNsMt2L4qsDhE9iWEbxTXIoIkeqBk/koSQPmRFb9lNvgxguCYEx9z1XnIWLsUjN/OO4kID9BjzQV0fOF4Ig3wo86XxZa1RpKRMNbQV4/FPm7m5LwgshI+7lJXy74juSqa9d+n5CJIQdchm+VvBa8bQBDpQE7b5+OFovchMEAz2eIssKLliwIn2AQ6i0xx6wGFw3bMdsbLmKhuJoJ/FpLx0h9+Okw+hqohnJdHAV6tnxNabfSiDFXZ6CcyA8lC98w6GcaIXkyKCkDZ827Vzj3voXdV5BnEh5/EwTG7XxReOeySKF57bNTnfzWl0DsvTNu30YftFjX+5f+JAFeo0QTI37qoklIj3yFYSqzDargfntft8C0cuJU2HbcW1RVp8+IGYP47xjr6zwcRtrXEPvEIbGQBt1+PsVPhPJdDqOWFYBdfYIFbfZajM9ax9kxh+gTGj69vjccGhF225HcU+AeH4VdtEh3VyeKvh7evM1muwEicZlpmkqqOpO0Biw3n9+nOwNe9d0Rh0+ruuSzzw8AV6iHjDNqwLU1cBtLmLCKoJJfdVdOhOjpPNfaHazkf7vbitItY5egl4NlCsi88ygAEIcrxw3jdmW2NAhTAoTgoMeCaul6qUo411zdM="
- DOCKER_BUILD=false
stages:
- build depends
- build src
- run tests
- build docker
builddepends: &builddepends
stage: build depends
script:
- $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh
buildsrc: &buildsrc
stage: build src
script:
- $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh
- $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh
runtests: &runtests
stage: run tests
script:
- $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh
- $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh
- $DOCKER_RUN_IN_BUILDER ./ci/test_unittests.sh
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude pruning,dbcrash"; fi
- $DOCKER_RUN_IN_BUILDER ./ci/test_integrationtests.sh --quiet --jobs=3 ${extended}
builddocker: &builddocker
stage: build docker
script:
# no need to run tests again here
- if [ "$DOCKER_BUILD" = "true" ]; then $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh && $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh && BUILD_DIR=build-ci/axecore-$BUILD_TARGET ./docker/build-docker.sh; fi
jobs:
include:
# build depends
- <<: *builddepends
env: BUILD_TARGET=arm-linux
- <<: *builddepends
env: BUILD_TARGET=win32
- <<: *builddepends
env: BUILD_TARGET=win64
- <<: *builddepends
env: BUILD_TARGET=linux32
- <<: *builddepends
env: BUILD_TARGET=linux64
- <<: *builddepends
env: BUILD_TARGET=linux64_nowallet
- <<: *builddepends
env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
- <<: *builddepends
env: BUILD_TARGET=mac
# build source
- <<: *buildsrc
env: BUILD_TARGET=arm-linux
- <<: *buildsrc
env: BUILD_TARGET=win32
- <<: *buildsrc
env: BUILD_TARGET=win64
- <<: *buildsrc
env: BUILD_TARGET=linux32
- <<: *buildsrc
env: BUILD_TARGET=linux64
- <<: *buildsrc
env: BUILD_TARGET=linux64_nowallet
- <<: *buildsrc
env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
- <<: *buildsrc
env: BUILD_TARGET=mac
# run tests (no tests for arm-linux and mac)
- <<: *runtests
env: BUILD_TARGET=win32
- <<: *runtests
env: BUILD_TARGET=win64
- <<: *runtests
env: BUILD_TARGET=linux32
- <<: *runtests
env: BUILD_TARGET=linux64
- <<: *runtests
env: BUILD_TARGET=linux64_nowallet
- <<: *runtests
env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
# build docker
- <<: *builddocker
env: BUILD_TARGET=linux64_release DOCKER_BUILD=true
before_cache:
# Save builder image
- docker save axe-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q axe-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/axe-builder-$BUILD_TARGET.tar.gz
install:
# Fix annoying Travis bug: a branch with a single commit has an empty TRAVIS_COMMIT_RANGE sometimes
- if [ -z "$TRAVIS_COMMIT_RANGE" ]; then export TRAVIS_COMMIT_RANGE="HEAD~..HEAD"; fi
# Our scripts try to be Travis agnostic
- export PULL_REQUEST="$TRAVIS_PULL_REQUEST"
- export COMMIT_RANGE="$TRAVIS_COMMIT_RANGE"
- export JOB_NUMBER="$TRAVIS_JOB_NUMBER"
- export HOST_SRC_DIR=$TRAVIS_BUILD_DIR
- export HOST_CACHE_DIR=$HOME/cache
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
- export PYTHON_DEBUG=1
- source ./ci/matrix.sh
- mkdir -p $HOST_CACHE_DIR/docker && mkdir -p $HOST_CACHE_DIR/ccache && mkdir -p $HOST_CACHE_DIR/depends && mkdir -p $HOST_CACHE_DIR/sdk-sources
# Keep this as it makes caching related debugging easier
- ls -lah $HOST_CACHE_DIR && ls -lah $HOST_CACHE_DIR/depends && ls -lah $HOST_CACHE_DIR/ccache && ls -lah $HOST_CACHE_DIR/docker
# Load cached builder image
- if [ -f $HOST_CACHE_DIR/docker/axe-builder-$BUILD_TARGET.tar.gz ]; then zcat $HOST_CACHE_DIR/docker/axe-builder-$BUILD_TARGET.tar.gz | docker load || true; fi
- travis_retry docker pull ubuntu:bionic
- travis_retry docker build -t $BUILDER_IMAGE_NAME --build-arg=USER_ID=$UID --build-arg=GROUP_ID=$UID --build-arg=BUILD_TARGET=$BUILD_TARGET -f ci/Dockerfile.builder ci
before_script:
# Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout
# See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed.
- python3 -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
# Build docker image only for development branch of the main repo
- if [ "$TRAVIS_REPO_SLUG" != "AXErunners/axe" -o "$TRAVIS_BRANCH" != "development" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then export DOCKER_BUILD="false"; echo DOCKER_BUILD=$DOCKER_BUILD; fi
after_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG
after_success:
- if [ "$DOCKER_BUILD" = "true" ]; then docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD && ./docker/push-docker.sh; fi