config.yml 11.1 KB
Newer Older
1
# Questions about this file?
2
# See https://gitlab.haskell.org/ghc/ghc/wikis/continuous-integration/usage.
3

4
version: 2
5 6 7

aliases:
  - &defaults
8
    working_directory: ~/ghc
9 10 11 12 13 14 15 16
  - &prepare
    run:
      name: prepare-system
      command: .circleci/prepare-system.sh
  - &submodules
    run:
      name: submodules
      command: .circleci/fetch-submodules.sh
17
  - &buildenv
Ben Gamari's avatar
Ben Gamari committed
18 19 20
    # ideally we would simply set THREADS here instead of re-detecting it every
    # time we need it below. Unfortunately, there is no way to set an environment
    # variable with the result of a shell script.
21
    SKIP_PERF_TESTS: NO
22 23 24 25
    VERBOSE: 2
  - &boot
    run:
      name: Boot
26 27
      command: |
        ./boot
28 29 30 31 32 33
  - &set_git_identity
      run:
        name: Set Git Identity
        command: |
          git config user.email "ghc-circleci@haskell.org"
          git config user.name "GHC CircleCI"
34 35 36
  - &configure_unix
    run:
      name: Configure
37
      command: ./configure 
38 39 40 41
  - &configure_unix_32
    run:
      name: Configure
      command: |
42
        setarch i386 ./configure --with-ghc=/opt/ghc-i386/8.4.2/bin/ghc
43 44 45 46
  - &configure_bsd
    run:
      name: Configure
      command: ./configure --target=x86_64-unknown-freebsd10
47 48 49 50
  - &configure_unreg
    run:
      name: Configure
      command: ./configure --enable-unregisterised
51
  - &make
52
    run:
53
      name: Build
54
      command: "make -j`mk/detect-cpu-count.sh` V=0"
Ben Gamari's avatar
Ben Gamari committed
55 56 57 58
  - &build_hadrian
    run:
      name: Build GHC using Hadrian
      command: |
59
        cabal update
Ben Gamari's avatar
Ben Gamari committed
60
        hadrian/build.sh -j`mk/detect-cpu-count.sh`
61 62 63
  - &test
    run:
      name: Test
64 65
      command: |
        mkdir -p test-results
66 67 68
        METRICS_FILE=$(mktemp)
        echo "export METRICS_FILE=$METRICS_FILE" >> $BASH_ENV
        make test THREADS=`mk/detect-cpu-count.sh` SKIP_PERF_TESTS=$SKIP_PERF_TESTS TEST_ENV=$TEST_ENV JUNIT_FILE=../../test-results/junit.xml METRICS_FILE=$METRICS_FILE
69 70 71
  - &store_test_results
    store_test_results:
      path: test-results
72 73 74 75
  - &push_perf_note
    run:
      name: Push Performance Git Notes
      command: .circleci/push-test-metrics.sh
76 77 78 79 80
  - &store_test_artifacts
    store_artifacts:
      # we might want to add the whole output of the test phase
      # too at some point
      path: test-results/junit.xml
81 82 83
  - &slowtest
    run:
      name: Full Test
84 85 86
      command: |
        mkdir -p test-results
        make slowtest SKIP_PERF_TESTS=YES THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../test-results/junit.xml
87 88 89
  - &bindist
    run:
      name: Create bindist
90
      # Reduce compression effort to 3
91
      command: make binary-dist TAR_COMP_OPTS="-2" && mv ghc*.tar.xz ghc.tar.xz
92 93 94
      # Building bindist takes ~15 minutes without output, account for
      # that.
      no_output_timeout: "30m"
95 96 97
  - &store_bindist
    store_artifacts:
      path: ghc.tar.xz
98 99 100 101 102 103
  - &only_release_tags
    tags:
      only: /^ghc-.*/
  - &ignore_gitlab_branches
    branches:
      ignore: /^gitlab\/.*/
104 105

jobs:
106
  "validate-x86_64-freebsd":
107
    docker:
108
      - image: ghcci/x86_64-freebsd
109
    environment:
110
      TARGET: FreeBSD
111
      <<: *buildenv
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
      GHC_COLLECTOR_FLAVOR: x86_64-freebsd
      TEST_ENV: x86_64-freebsd
    steps:
      - checkout
      - *set_git_identity
      - *prepare
      - *submodules
      - *boot
      - *configure_bsd
      - *make
      - *bindist
      - *store_bindist
      - *test
      - *store_test_results
      - *store_test_artifacts
      - *push_perf_note

  "validate-x86_64-darwin":
    macos:
      xcode: "9.0"
    environment:
      # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
      BUILD_SPHINX_PDF: "NO"
      MACOSX_DEPLOYMENT_TARGET: "10.7"
      # Only Sierra and onwards supports clock_gettime. See #12858
      ac_cv_func_clock_gettime: "no"
      GHC_COLLECTOR_FLAVOR: x86_64-darwin
      <<: *buildenv
      TEST_ENV: x86_64-darwin
141 142
    steps:
      - checkout
143
      - *set_git_identity
144 145
      - *prepare
      - *submodules
146 147 148 149
      - *boot
      - *configure_unix
      - *make
      - *bindist
150
      - *store_bindist
151
      - *test
152
      - *store_test_results
153
      - *store_test_artifacts
154
      - *push_perf_note
155

156
  "validate-x86_64-linux-deb8":
157
    docker:
158
      - image: ghcci/x86_64-linux-deb8:0.1
159
    environment:
160
      <<: *buildenv
161 162
      GHC_COLLECTOR_FLAVOR: x86_64-linux
      TEST_ENV: x86_64-linux-deb8
163 164
    steps:
      - checkout
165
      - *set_git_identity
166 167
      - *prepare
      - *submodules
168
      - *boot
169
      - *configure_unix
170 171
      - *make
      - *bindist
172
      - *store_bindist
173
      - *test
174
      - *store_test_results
175
      - *store_test_artifacts
176
      - *push_perf_note
177

178 179
  "validate-x86_64-linux-deb9-integer-simple":
    docker:
Ben Gamari's avatar
Ben Gamari committed
180
      - image: ghcci/x86_64-linux-deb9:0.2
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
    environment:
      <<: *buildenv
      INTEGER_LIBRARY: integer-simple
      GHC_COLLECTOR_FLAVOR: x86_64-linux-deb9
    steps:
      - checkout
      - *set_git_identity
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *bindist
      - *store_bindist
      - *test
      - *store_test_results
      - *store_test_artifacts
      - *push_perf_note

200 201 202
  "validate-x86_64-linux-deb9":
    docker:
      - image: ghcci/x86_64-linux-deb9:0.1
Ben Gamari's avatar
Ben Gamari committed
203
    environment:
204
      <<: *buildenv
205
      GHC_COLLECTOR_FLAVOR: x86_64-linux-deb9
206
      TEST_ENV: x86_64-linux-deb9
207
    steps:
208
      - checkout
209
      - *set_git_identity
210 211
      - *prepare
      - *submodules
212 213 214 215
      - *boot
      - *configure_unix
      - *make
      - *bindist
216
      - *store_bindist
217
      - *test
218
      - *store_test_results
219
      - *store_test_artifacts
220
      - *push_perf_note
221

222
  "validate-hadrian-x86_64-linux-deb8":
Ben Gamari's avatar
Ben Gamari committed
223
    docker:
224
      - image: ghcci/x86_64-linux-deb8:0.1
Ben Gamari's avatar
Ben Gamari committed
225 226 227 228
    environment:
      <<: *buildenv
    steps:
      - checkout
229
      - *set_git_identity
Ben Gamari's avatar
Ben Gamari committed
230 231 232 233 234 235
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *build_hadrian

236
  "validate-x86_64-linux-deb8-unreg":
237
    docker:
238
      - image: ghcci/x86_64-linux-deb8:0.1
239 240
    environment:
      <<: *buildenv
241
      TEST_ENV: x86_64-linux-deb8-unreg
242 243
    steps:
      - checkout
244
      - *set_git_identity
245 246 247 248 249 250
      - *prepare
      - *submodules
      - *boot
      - *configure_unreg
      - *make
      - *test
251
      - *store_test_results
252
      - *push_perf_note
253
      - *store_test_artifacts
254

Ben Gamari's avatar
Ben Gamari committed
255
  "validate-x86_64-linux-deb9-llvm":
256
    docker:
Ben Gamari's avatar
Ben Gamari committed
257
      - image: ghcci/x86_64-linux-deb9:0.2
258 259 260
    environment:
      <<: *buildenv
      BUILD_FLAVOUR: perf-llvm
Ben Gamari's avatar
Ben Gamari committed
261
      TEST_ENV: x86_64-linux-deb9-llvm
262 263 264 265 266
    steps:
      - run:
          name: Verify that llc works
          command: llc
      - checkout
267
      - *set_git_identity
268 269 270 271 272
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
273
      - *test
274 275
      - *store_test_results
      - *store_test_artifacts
276
      - *push_perf_note
277

278
  # Nightly build with -DDEBUG using devel2 flavour
279
  "validate-x86_64-linux-deb8-debug":
280
    docker:
281
      - image: ghcci/x86_64-linux-deb8:0.1
282 283 284
    environment:
      BUILD_FLAVOUR: devel2
      <<: *buildenv
285
      TEST_ENV: x86_64-linux-deb8-debug
286
      SKIP_PERF_TESTS: YES
287 288
    steps:
      - checkout
289
      - *set_git_identity
290 291 292
      - *prepare
      - *submodules
      - *boot
293
      - *configure_unix
294 295
      - *make
      - *test
296
      - *store_test_results
297
      - *store_test_artifacts
298
      - *push_perf_note
299

300 301
  "validate-i386-linux-deb9":
    docker:
Ben Gamari's avatar
Ben Gamari committed
302
      - image: ghcci/i386-linux-deb9:0.2
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
    environment:
      <<: *buildenv
      GHC_COLLECTOR_FLAVOR: i386-linux-deb9
      TEST_ENV: i386-linux-deb9
    steps:
      - checkout
      - *set_git_identity
      - *prepare
      - *submodules
      - *boot
      - *configure_unix_32
      - *make
      - *bindist
      - *store_bindist
      - *test
      - *store_test_results
      - *store_test_artifacts
      - *push_perf_note

  "validate-i386-linux-deb8":
323
    docker:
324
      - image: ghcci/i386-linux-deb8:0.1
325 326
    environment:
      <<: *buildenv
327
      GHC_COLLECTOR_FLAVOR: i386-linux
328
      TEST_ENV: i386-linux-deb8
329 330
    steps:
      - checkout
331
      - *set_git_identity
332 333 334 335 336 337
      - *prepare
      - *submodules
      - *boot
      - *configure_unix_32
      - *make
      - *bindist
338
      - *store_bindist
339
      - *test
340
      - *store_test_results
341
      - *store_test_artifacts
342
      - *push_perf_note
343

344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
  "validate-x86_64-linux-centos7":
    docker:
      - image: ghcci/x86_64-linux-centos7:0.1
    environment:
      <<: *buildenv
      GHC_COLLECTOR_FLAVOR: x86_64-centos7
      LANG: en_US.UTF-8
      TEST_ENV: x86_64-centos7
      # Sphinx is too old
      BUILD_SPHINX_PDF: NO
    steps:
      - checkout
      - *set_git_identity
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *bindist
      - *store_bindist
      - *test
      - *store_test_results
      - *store_test_artifacts
      - *push_perf_note

  "validate-x86_64-linux-fedora27":
Mark Karpov's avatar
Mark Karpov committed
370
    docker:
371
      - image: ghcci/x86_64-linux-fedora27:0.1
Mark Karpov's avatar
Mark Karpov committed
372 373
    environment:
      <<: *buildenv
374
      GHC_COLLECTOR_FLAVOR: x86_64-fedora
375
      TEST_ENV: x86_64-linux-fedora27
Mark Karpov's avatar
Mark Karpov committed
376 377
    steps:
      - checkout
378
      - *set_git_identity
Mark Karpov's avatar
Mark Karpov committed
379 380 381 382 383 384
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *bindist
385
      - *store_bindist
386
      - *test
387
      - *store_test_results
388
      - *store_test_artifacts
389
      - *push_perf_note
Mark Karpov's avatar
Mark Karpov committed
390

391
  "slow-validate-x86_64-linux-deb8":
392
    docker:
393
      - image: ghcci/x86_64-linux-deb8:0.1
394 395
    environment:
      <<: *buildenv
396
      GHC_COLLECTOR_FLAVOR: x86_64-linux-deb8
397 398 399 400 401 402 403 404
    steps:
      - checkout
      - *prepare
      - *submodules
      - *boot
      - *configure_unix
      - *make
      - *slowtest
405
      - *store_test_results
406
      - *store_test_artifacts
407
      - *push_perf_note
408

409 410 411 412
workflows:
  version: 2
  validate:
    jobs:
413
    - validate-x86_64-linux-deb8:
414 415
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
416 417
    # FreeBSD disabled: https://github.com/haskell/unix/issues/102
    # - validate-x86_64-freebsd
418
    - validate-x86_64-darwin:
419 420 421 422 423
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
    - validate-x86_64-linux-deb8-llvm:
        filters:
          <<: *ignore_gitlab_branches
424
    - validate-i386-linux-deb8:
425 426
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
427
    - validate-x86_64-linux-deb9:
428 429
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
430
    - validate-i386-linux-deb9:
431 432
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
433
    - validate-x86_64-linux-centos7:
434 435 436 437 438
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
    - validate-hadrian-x86_64-linux-deb8:
        filters:
          <<: *ignore_gitlab_branches
439
    - validate-x86_64-linux-fedora27:
440 441
        filters:
          <<: [*only_release_tags, *ignore_gitlab_branches]
442

443 444 445 446 447 448 449 450 451
  nightly:
    triggers:
      - schedule:
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
452 453 454
    - validate-x86_64-linux-deb8-unreg
    - validate-x86_64-linux-deb8-llvm
    - validate-x86_64-linux-deb8-debug
455 456
    - validate-x86_64-linux-deb9
    - validate-x86_64-linux-deb9-integer-simple
457
    - slow-validate-x86_64-linux-deb8
458

459 460 461
notify:
  webhooks:
    - url: https://phabricator.haskell.org/harbormaster/hook/circleci/