summaryrefslogtreecommitdiffstats
path: root/.cirrus.yml
blob: 235a3c65a154917783406ed4b3eb97ad3790264b (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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
freebsd_task:
    matrix:
        - name: FreeBSD 11.4
          freebsd_instance:
            image: freebsd-11-4-release-amd64
        - name: FreeBSD 12.1
          freebsd_instance:
            image: freebsd-12-1-release-amd64

    cargo_cache:
        folder: $HOME/.cargo/registry
        fingerprint_script: cat Cargo.lock

    env:
        HOME: /home/testuser
        RUSTFLAGS: '-D warnings'

    install_script:
        # Make sure we use the same package repository for all images. Snapshots
        # (like 11.3-STABLE) default to latest, while releases default to quarterly.
        - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf        
        - pkg update -f
        - pkg upgrade -y
        - pkg install -y rust gmake rubygem-asciidoctor pkgconf stfl curl json-c ncurses openssl sqlite3 gettext-tools libxml2
    setup_script:
        - pw groupadd testgroup
        - pw useradd testuser -g testgroup -w none -m
        - cp -R . $HOME
        - chown -R testuser:testgroup $HOME
    # 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.
    #
    # Running three jobs because by default, VMs have 2 cores.
    build_script: su testuser -c 'cd ~ && gmake --jobs=3 --keep-going all test'
    test_script: su testuser -c 'cd ~ && ( cd test && ./test --order rand ); ret=$?; (RUST_BACKTRACE=1 cargo test --jobs=3) && sh -c "exit $ret"'
    before_cache_script: &before_cache_script
        - rm -rf $HOME/.cargo/registry/index

32bit_ubuntu_task:
    name: Linux i686 (Ubuntu 18.04)
    container:
        dockerfile: docker/ubuntu_18.04-i686.dockerfile
    cargo_cache:
        folder: $HOME/.cargo/registry
        fingerprint_script: cat Cargo.lock
    env:
        RUSTFLAGS: '-D warnings'
    build_script: &build_script
        - make -j3 --keep-going all test
    test_script: &test_script
        # We want to run both C++ and Rust tests, but we also want this entire
        # command to fail if one of the test suites fails. That's why we store
        # the C++'s exit code and chain it to Rust's in the end.
        - ( cd test && ./test --order rand ); ret=$?; (RUST_BACKTRACE=1 cargo test --jobs=3) && sh -c "exit $ret"
    before_cache_script: *before_cache_script

macos_task:
    osx_instance:
        image: catalina-base

    cargo_cache:
        folder: $HOME/.cargo/registry
        fingerprint_script: cat Cargo.lock

    install_script:
        - brew update
        - brew install rustup-init
        - brew install gcc || brew link --overwrite gcc
        - brew install python
        - export PATH=/usr/local/opt/python/libexec/bin:$PATH
        - brew uninstall rbenv ruby-build # ...so that it won't be upgraded when pkg-config is upgraded, because upgrading ruby-build fails; see https://github.com/newsboat/newsboat/issues/866
        - 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 install "json-c"
        - brew install "asciidoctor"
        - brew install "libxml2"
        - brew install "pyenv" || brew upgrade "pyenv"
        - rustup-init -y --default-toolchain $RUST
        - eval "$(pyenv init -)"
        - pip3 install cpp-coveralls
        - pyenv rehash
        - rustc --version && cargo --version

    env:
        GCOV: /usr/bin/gcov
        PKG_CONFIG_PATH: /usr/local/opt/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
        PATH: $HOME/.cargo/bin:/usr/local/opt/gettext/bin:$PATH
        LDFLAGS: -L/usr/local/opt/gettext/lib
        CFLAGS: -I/usr/local/opt/gettext/include
        CXXFLAGS: -I/usr/local/opt/gettext/include
        GETTEXT_DIR: /usr/local/opt/gettext
        RUSTFLAGS: '-D warnings'

    build_script: *build_script
    test_script: *test_script
    before_cache_script: *before_cache_script

    matrix:
        - name: macOS Clang Rust stable
          env:
              CC: clang
              CXX: clang++
              RUST: stable
        - name: macOS GCC Rust stable
          env:
              CC: gcc
              CXX: g++
              RUST: stable
        # This job tests our minimum supported Rust version, so only bump on
        # Newsboat release day
        - name: macOS GCC Rust 1.40.0
          env:
              CC: gcc
              CXX: g++
              RUST: 1.40.0

formatting_task:
    name: Code formatting
    container:
        dockerfile: docker/code-formatting-tools.dockerfile
        cpu: 1
        memory: 512MB
    script:
        - make fmt
          # --exit-code forces git-diff to exit with code 1 if there were
          # changes; that'll fail the build, which is exactly what we need
        - git diff --exit-code

linux_task:
    matrix:
        # These two jobs test our minimum supported Rust version, so only bump on
        # Newsboat release day
        - name: Rust 1.40.0, GCC 4.9 (Ubuntu 16.04)
          container:
            dockerfile: docker/ubuntu_16.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-4.9
                cc: gcc-4.9
                cxx: g++-4.9
                rust_version: 1.40.0
        - name: Rust 1.40.0, GCC 9 (Ubuntu 20.04)
          container:
            dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-9
                cc: gcc-9
                cxx: g++-9
                rust_version: 1.40.0

        - name: GCC 10, more warnings and checks (Ubuntu 20.04)
          container:
            dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-10
                cc: gcc-10
                cxx: g++-10
          env: &extra_warnings_and_checks_env
            CXXFLAGS: "-D_GLIBCXX_ASSERTIONS -Wformat -Wformat-security -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wnull-dereference -Wdouble-promotion -O3"
        - name: Clang 10, more warnings and checks (Ubuntu 20.04)
          container:
            dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-10
                cc: clang-10
                cxx: clang++-10
          env: *extra_warnings_and_checks_env

        - name: Rust 1.43.1, GCC 4.9 (Ubuntu 16.04)
          container:
            dockerfile: docker/ubuntu_16.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-4.9
                cc: gcc-4.9
                cxx: g++-4.9
        - name: Rust 1.43.1, GCC 5 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-5
                cc: gcc-5
                cxx: g++-5
        - name: Rust 1.43.1, GCC 6 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-6
                cc: gcc-6
                cxx: g++-6
        - name: Rust 1.43.1, GCC 7 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-7
                cc: gcc-7
                cxx: g++-7
        - name: Rust 1.43.1, GCC 8 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-8
                cc: gcc-8
                cxx: g++-8
        - name: Rust 1.43.1, GCC 9 (Ubuntu 20.04)
          container:
            dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-9
                cc: gcc-9
                cxx: g++-9
        - name: Rust 1.43.1, GCC 10 (Ubuntu 20.04)
          container:
            dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: g++-10
                cc: gcc-10
                cxx: g++-10
        - name: Rust 1.43.1, Clang 4.0 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-4.0
                cc: clang-4.0
                cxx: clang++-4.0
        - name: Rust 1.43.1, Clang 5.0 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-5.0
                cc: clang-5.0
                cxx: clang++-5.0
        - name: Rust 1.43.1, Clang 6.0 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-6.0
                cc: clang-6.0
                cxx: clang++-6.0
        - name: Rust 1.43.1, Clang 7 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-7
                cc: clang-7
                cxx: clang++-7
        - name: Rust 1.43.1, Clang 8 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-8
                cc: clang-8
                cxx: clang++-8
        - name: Rust 1.43.1, Clang 9 (Ubuntu 18.04)
          container:
            dockerfile: docker/ubuntu_18.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-9
                cc: clang-9
                cxx: clang++-9
        - name: Rust 1.43.1, Clang 10 (Ubuntu 20.04)
          container:
            dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
            docker_arguments:
                cxx_package: clang-10
                cc: clang-10
                cxx: clang++-10

    cargo_cache:
        folder: $HOME/.cargo/registry
        fingerprint_script: cat Cargo.lock

    env:
        RUSTFLAGS: '-D warnings'

    build_script: *build_script
    test_script: *test_script
    before_cache_script: *before_cache_script

address_sanitizer_task:
    name: AddressSanitizer (Clang 10, Ubuntu 20.04)

    container:
      dockerfile: docker/ubuntu_20.04-build-tools.dockerfile
      docker_arguments:
          # We need llvm-symbolizer from llvm-10-tools to demangle symbols in
          # sanitizer's reports
          cxx_package: "clang-10 llvm-10"
          cc: clang-10
          cxx: clang++-10

    env:
      CXXFLAGS: "-fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls -g"
      ASAN_OPTIONS: "check_initialization_order=1:detect_stack_use_after_return=1"

    cargo_cache: