-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis.yml
184 lines (158 loc) · 5.1 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
sudo: required
dist: bionic
language: minimal
addons:
apt:
sources:
- sourceline: ppa:hets/hets
# here 'git clone ...' happens
env:
global:
# Set to 1 to skip the related stage
- SKIP_STACK=0 SKIP_BUILD=0 SKIP_TEST=0 SKIP_HADDOCK=0
# Unset to disable caching of native packages
- PKG_CACHE=/var/tmp/pkgs
# Unset to use dumb travis-ci caches, only (which usually breaks this or
# that jobs, because "artifacts" need to be rebuilt which takes more than
# 50 min and thus hits the time limit for non-private jobs and gets killed).
- SMART_CACHE=1
# Prevent building docs. Uncomment to build them.
- NO_DOCS=1
# Upload a copy of the build dir before and after syncing with the repo
#- MKDBG=1
# Uncomment the next line to build w/o stack
- STACK_ROOT=/var/tmp/stack
# Here we build and cache builds
- HETS_BASEDIR=/var/tmp/hets HETS_BUILD_DIR=${HETS_BASEDIR}/build
- PREFIX=/tmp/hets-install
- PATH=${PREFIX}/bin:${STACK_ROOT}/bin:${PATH}
- HETS_LIB=/var/tmp/Hets-lib
- HETS_MAGIC=${TRAVIS_BUILD_DIR}/magic/hets.magic
- TH=utils/travis-helper.sh
cache:
# we push a lot, so 180s are sometimes not enough ...
timeout: 600
directories:
- ${STACK_ROOT:-/empty}
- ${PKG_CACHE:-/empty}
- ${HETS_LIB}
- ${HETS_BASEDIR}
install:
- set >/tmp/set
- date '+%s' >/tmp/timestamp ; date
- ${TH} myShowCacheUsage
# because the context is important, we need to call 'set' explicitly _here_
- ls -al ${HOME}/.casher
- ${TH} myShowInfo short
- ${TH} myCheckStack
- ${TH} myGetMissingPkgs
- ${TH} myCheckHetslib
before_cache:
- ksh -c 'printf "%(%s)T\n" now ; printf "%T\n" now'
- ${TH} myBefore_cache
- ${TH} myShowCacheUsage
after_script:
- ksh -c 'printf "%(%s)T\n" now ; printf "%T\n" now'
- ls -al ${HOME}/.casher
jobs:
include:
# .1
- stage: Stack
if: env(STACK_ROOT) IS present AND env(SKIP_STACK) != 1
before_install:
- echo stack >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
# Compile Hets
- make stack && touch ${STACK_ROOT}/bin/stack.done
- stack exec -- ghc -V
# .2
- stage: Build
if: type != push AND env(SKIP_BUILD) != 1
before_install:
- echo server >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
- utils/travisKnockKnock.sh -t 180 -i 15 -s 5120 -c 'make hets_server.bin' -x hets_server.bin
- ./hets_server.bin -V
# .3
- stage: Build
if: type != push AND env(SKIP_BUILD) != 1
before_install:
- echo desktop >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
- utils/travisKnockKnock.sh -t 180 -i 15 -s 5120 -c 'make hets.bin' -x hets.bin
- ./hets.bin -V
# owl is cheap - build on demand
# .4
- stage: test
if: type != push AND env(SKIP_TEST) != 1
before_install:
- echo check >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
# Run the test (make install not needed for this test)
- make check
# .5
- stage: test
if: type != push AND env(SKIP_TEST) != 1
before_install:
- echo hets-lib >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
- touch hets_server.bin
- utils/travisKnockKnock.sh -t 180 -i 15 -s 5120
- hets -V
# Run hets through Hets-lib
# Install Hets - this does not need to recompile Hets
- test/hets-lib-check.sh
# .6
- stage: test
if: type != push AND env(SKIP_TEST) != 1
before_install:
- echo pg >/tmp/JOB_NAME
script:
- ${TH} myShutdownPgDB
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
- touch hets.bin
- ksh93 utils/travisKnockKnock.sh -t 180 -i 15 -s 5120
- hets-server -V
# For some reason, Travis CI sets this environment variable, which
# breaks tests (_JAVA_OPTIONS=-Xmx2048m -Xms512m)
- unset _JAVA_OPTIONS
# Run hets_server through Hets-lib
# Install Hets - this does not need to recompile Hets
- test/hets-lib-database-check.sh 'PostgreSQL'
# .7
- stage: test
if: type != push AND env(SKIP_TEST) != 1
before_install:
- echo sqlite >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
- touch hets_server.bin
- utils/travisKnockKnock.sh -t 180 -i 15 -s 5120
- hets -V
# Run hets through Hets-lib
# Install Hets - this does not need to recompile Hets
- test/hets-lib-database-check.sh 'SQLite'
# .8
- stage: test
# docs can be buid in parallel to testing to safe a little bit time.
# Furthermore we do not want generated docs go into the travis-cache.
if: env(SKIP_HADDOCK) != 1
before_install:
- echo haddock >/tmp/JOB_NAME
script:
- ${TH} myPrepareBuildDir
- cd ${HETS_BUILD_DIR}
- make docs
- ${TH} myUploadDocs