summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: 25888f42037f2ee71e8bcf193f124b99583a6177 (plain)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
language: rust

rust: stable

addons:
  apt:
    packages: &global_deps
    - libsqlite3-dev
    - libcurl4-openssl-dev
    - libxml2-dev
    - libstfl-dev
    - libjson-c-dev
    - libncursesw5-dev
    - asciidoc
    - libxml2-utils
    - xsltproc
    - docbook-xml
    - docbook-xsl
addons:
  apt:
    packages: &clang_deps
    - *global_deps
    - g++-4.9 # required for some niceties in C++ standard library

install_coveralls_commands: &install_coveralls
  - pip install --user cpp-coveralls

newsboat_brew_commands: &osx_deps
  - brew update
  - brew install gcc || brew link --overwrite gcc
  - brew outdated "pkg-config" || brew upgrade "pkg-config"
  - brew install "gettext" && brew link --force "gettext"
  - brew outdated "sqlite" || brew upgrade "sqlite"
  - brew outdated "curl" || brew upgrade "curl"
  - brew install "libstfl"
  - brew outdated "json-c" || brew upgrade "json-c"
  - brew install "asciidoc"
  - brew install "docbook-xsl"
  - brew outdated "python" || brew upgrade "python"
  - brew install "pyenv" || brew upgrade "pyenv"
  - eval "$(pyenv init -)"
  - pip3 install cpp-coveralls
  - pyenv rehash

matrix:
  fast_finish: true
  include:
    - compiler: gcc-4.9
      os: linux
      rust: 1.25.0
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
            - *global_deps
      env:
        - COMPILER=g++-4.9
        - GCOV=/usr/bin/gcov-4.9
      before_install:
        *install_coveralls
    - compiler: gcc-4.9
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
            - *global_deps
      env:
        - COMPILER=g++-4.9
        - GCOV=/usr/bin/gcov-4.9
      before_install:
        *install_coveralls
    - compiler: gcc-5
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-5
            - *global_deps
      env:
        - COMPILER=g++-5
        - GCOV=/usr/bin/gcov-5
      before_install:
        *install_coveralls
    - compiler: gcc-6
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-6
            - *global_deps
      env:
        - COMPILER=g++-6
        - GCOV=/usr/bin/gcov-6
      before_install:
        *install_coveralls
    - compiler: gcc-7
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
            - *global_deps
      env:
        - COMPILER=g++-7
        - GCOV=/usr/bin/gcov-7
      before_install:
        *install_coveralls
    - compiler: gcc-8
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-8
            - *global_deps
      env:
        - COMPILER=g++-8
        - GCOV=/usr/bin/gcov-8
      before_install:
        *install_coveralls
    - compiler: clang
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - *clang_deps
      env:
        - COMPILER=clang++
        - GCOV="llvm-cov gcov"
      before_install:
        *install_coveralls
    - compiler: clang-4.0
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-trusty-4.0
          packages:
            - clang-4.0
            - llvm-4.0
            - *clang_deps
      env:
        - COMPILER=clang++-4.0
        - GCOV="llvm-cov-4.0 gcov"
      before_install:
        *install_coveralls
    - compiler: clang-5.0
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-trusty-5.0
          packages:
            - clang-5.0
            - llvm-5.0
            - *clang_deps
      env:
        - COMPILER=clang++-5.0
        - GCOV="llvm-cov-5.0 gcov"
      before_install:
        *install_coveralls
    - compiler: clang-6.0
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-trusty-6.0
          packages:
            - clang-6.0
            - llvm-6.0
            - *clang_deps
      env:
        - COMPILER=clang++-6.0
        - GCOV="llvm-cov-6.0 gcov"
      before_install:
        *install_coveralls
    - compiler: clang-7
      os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-trusty-7
          packages:
            - clang-7
            - llvm-7
            - *clang_deps
      env:
        - COMPILER=clang++-7
        - GCOV="llvm-cov-7 gcov"
      before_install:
        *install_coveralls
    - compiler: gcc
      os: osx
      rust: 1.25.0
      env:
        - COMPILER=g++
        - GCOV=/usr/bin/gcov
        # a2x will run xmllint on generated files, so we have to pass the path
        # to AsciiDoc's catalog files
        - XML_CATALOG_FILES=/usr/local/etc/xml/catalog
      before_install:
        *osx_deps
    - compiler: gcc
      os: osx
      env:
        - COMPILER=g++
        - GCOV=/usr/bin/gcov
        # a2x will run xmllint on generated files, so we have to pass the path
        # to AsciiDoc's catalog files
        - XML_CATALOG_FILES=/usr/local/etc/xml/catalog
      before_install:
        *osx_deps
    - compiler: clang
      os: osx
      env:
        - COMPILER=clang++
        - GCOV=/usr/bin/gcov
        # a2x will run xmllint on generated files, so we have to pass the path
        # to AsciiDoc's catalog files
        - XML_CATALOG_FILES=/usr/local/etc/xml/catalog
      before_install:
        *osx_deps
    - addons:
        apt:
          packages:
            - i18nspector
      env:
        - CHECKS=i18nspector
    - addons:
        apt:
          packages: []
      env:
        - CHECKS="cargo-fmt"
      before_install:
        - rustup component add rustfmt

install:
  - export CXX=$COMPILER
  - cd ${TRAVIS_BUILD_DIR}

script:
  - cd ${TRAVIS_BUILD_DIR}
  # CI builds take a while to provision, install dependencies and compile our
  # stuff. To maximize the benefits, we ask Make to process as many rules as
  # possible before failing. This enables developers to fix more errors before
  # re-submitting the code to CI, which should increase throughput.
  - if [ -z "$CHECKS" ]; then   make -j2 --keep-going all test   ; fi
  - if [ -z "$CHECKS" ]; then   make distclean   ; fi
  - if [ -z "$CHECKS" ]; then   make -j2 PROFILE=1 all test   ; fi
  # We want to run both C++ and Rust tests, but we also want this entire
  # command to fail if some test suite fails. That's why we store the C++'s
  # exit code and chain it to Rust's in the end.
  - if [ -z "$CHECKS" ]; then   ( cd test && ./test --order rand ); ret=$?; (cargo test) && sh -c "exit $ret"   ; fi
  - if [ "$CHECKS" = "i18nspector" ]; then   make run-i18nspector | tee i18nspector.log && if `egrep '^(E|W):' i18nspector.log >/dev/null 2>&1` ; then false else true; fi   ; fi
  - if [ "$CHECKS" = "cargo-fmt" ]; then cargo fmt -- --check; fi

after_success:
  - cd ${TRAVIS_BUILD_DIR}
  - if [ -z "$CHECKS" ]; then   ./submit-to-coveralls.sh   ; fi