Hadrian: add a --test-accept/-a flag, to mimic 'make accept'
[ghc.git] / .gitlab-ci.yml
1 variables:
2   GIT_SSL_NO_VERIFY: "1"
3
4   # Commit of ghc/ci-images repository from which to pull Docker images
5   DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c
6
7   # Sequential version number capturing the versions of all tools fetched by
8   # .gitlab/win32-init.sh.
9   WINDOWS_TOOLCHAIN_VERSION: 1
10
11 before_script:
12   - python3 .gitlab/fix-submodules.py
13   - git submodule sync --recursive
14   - git submodule update --init --recursive
15   - git checkout .gitmodules
16   - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
17
18 stages:
19   - lint       # Source linting
20   - build      # A quick smoke-test to weed out broken commits
21   - full-build # Build all the things
22   - cleanup    # See Note [Cleanup on Windows]
23   - packaging  # Source distribution, etc.
24   - hackage    # head.hackage testing
25   - deploy     # push documentation
26
27 .only-default: &only-default
28   only:
29     - master
30     - /ghc-[0-9]+\.[0-9]+/
31     - merge_requests
32     - tags
33
34 ############################################################
35 # Runner Tags
36 ############################################################
37 #
38 # * x86_64-linux: Any Docker-capable x86_64 Linux machine
39 # * aarch64-linux: Any Docker-capable AArch64 Linux machine
40 # * x86_64-windows: A x86_64 Windows machine
41 # * lint: Any Docker-capable x86_64 Linux machine; distinct from
42 #         x86_64-linux to ensure low-latency availability.
43 #
44
45
46 ############################################################
47 # Linting
48 ############################################################
49
50 ghc-linters:
51   allow_failure: true
52   stage: lint
53   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
54   script:
55     - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
56     - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
57     - "echo Merge base $base"
58     #    - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
59     - validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
60     - .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
61     - .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
62     - .gitlab/linters/check-version-number.sh
63   dependencies: []
64   tags:
65     - lint
66   only:
67     refs:
68       - merge_requests
69
70 # We allow the submodule checker to fail when run on merge requests (to
71 # accomodate, e.g., haddock changes not yet upstream) but not on `master` or
72 # Marge jobs.
73 .lint-submods:
74   stage: lint
75   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
76   script:
77     - submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
78   dependencies: []
79   tags:
80     - lint
81
82 lint-submods:
83   extends: .lint-submods
84   only:
85     refs:
86       - master
87       - /ghc-[0-9]+\.[0-9]+/
88       - wip/marge_bot_batch_merge_job
89
90 lint-submods-mr:
91   extends: .lint-submods
92   allow_failure: true
93   only:
94     refs:
95       - merge_requests
96
97 .lint-changelogs:
98   stage: lint
99   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
100   dependencies: []
101   tags:
102     - lint
103   script:
104     - |
105       grep TBA libraries/*/changelog.md && (
106           echo "Error: Found \"TBA\"s in changelogs."
107           exit 1
108       )
109
110 lint-changelogs:
111   extends: .lint-changelogs
112   allow_failure: true
113   only:
114     refs:
115       - /ghc-[0-9]+\.[0-9]+/
116
117 lint-release-changelogs:
118   extends: .lint-changelogs
119   only:
120     - tags
121
122
123 ############################################################
124 # Validation via Pipelines (hadrian)
125 ############################################################
126
127 .validate-hadrian:
128   <<: *only-default
129   allow_failure: true
130   script:
131     - cabal update
132     - git clean -xdf && git submodule foreach git clean -xdf
133     - bash .circleci/prepare-system.sh
134     - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
135     - ./boot
136     - ./configure $CONFIGURE_ARGS
137     - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist
138     - mv _build/bindist/ghc*.tar.xz ghc.tar.xz
139   cache:
140     key: hadrian
141     paths:
142       - cabal-cache
143   artifacts:
144     when: always
145     paths:
146       - ghc.tar.xz
147
148 validate-x86_64-linux-deb8-hadrian:
149   extends: .validate-hadrian
150   stage: build
151   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV"
152   before_script:
153     # workaround for docker permissions
154     - sudo chown ghc:ghc -R .
155     - python3 .gitlab/fix-submodules.py
156     - git submodule sync --recursive
157     - git submodule update --init --recursive
158     - git checkout .gitmodules
159     - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
160   tags:
161     - x86_64-linux
162
163 hadrian-ghc-in-ghci:
164   <<: *only-default
165   stage: build
166   image: ghcci/x86_64-linux-deb8:0.1
167   before_script:
168     # workaround for docker permissions
169     - sudo chown ghc:ghc -R .
170     - python3 .gitlab/fix-submodules.py
171     - git submodule sync --recursive
172     - git submodule update --init --recursive
173     - git checkout .gitmodules
174   tags:
175     - x86_64-linux
176   script:
177     - cabal update
178     - git clean -xdf && git submodule foreach git clean -xdf
179     - bash .circleci/prepare-system.sh
180     - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
181     - ./boot
182     - ./configure $CONFIGURE_ARGS
183     # Load ghc-in-ghci then immediately exit and check the modules loaded
184     - echo ":q" | hadrian/ghci.sh | tail -n2 | grep "Ok,"
185   cache:
186     key: hadrian-ghci
187     paths:
188       - cabal-cache
189
190 ############################################################
191 # Validation via Pipelines (make)
192 ############################################################
193
194 .validate:
195   <<: *only-default
196   variables:
197     TEST_TYPE: test
198   before_script:
199     - git clean -xdf && git submodule foreach git clean -xdf
200   script:
201     - ./boot
202     - ./configure $CONFIGURE_ARGS
203     - |
204       THREADS=`mk/detect-cpu-count.sh`
205       make V=0 -j$THREADS WERROR=-Werror
206     - |
207       make binary-dist TAR_COMP_OPTS="-1"
208     - |
209       # Prepare to push git notes.
210       METRICS_FILE=$(mktemp)
211       git config user.email "ben+ghc-ci@smart-cactus.org"
212       git config user.name "GHC GitLab CI"
213     - |
214       THREADS=`mk/detect-cpu-count.sh`
215       make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml METRICS_FILE=$METRICS_FILE
216     - |
217       # Push git notes.
218       METRICS_FILE=$METRICS_FILE .gitlab/push-test-metrics.sh
219   dependencies: []
220   artifacts:
221     reports:
222       junit: junit.xml
223     expire_in: 2 week
224     paths:
225       - ghc-*.tar.xz
226       - junit.xml
227
228 #################################
229 # x86_64-darwin
230 #################################
231
232 validate-x86_64-darwin:
233   extends: .validate
234   stage: full-build
235   tags:
236     - x86_64-darwin
237   variables:
238     GHC_VERSION: 8.6.3
239     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-apple-darwin.tar.xz"
240     MACOSX_DEPLOYMENT_TARGET: "10.7"
241     # Only Sierra and onwards supports clock_gettime. See #12858
242     ac_cv_func_clock_gettime: "no"
243     LANG: "en_US.UTF-8"
244     CONFIGURE_ARGS: --with-intree-gmp
245     TEST_ENV: "x86_64-darwin"
246   before_script:
247     - git clean -xdf && git submodule foreach git clean -xdf
248     - python3 .gitlab/fix-submodules.py
249     - git submodule sync --recursive
250     - git submodule update --init --recursive
251     - git checkout .gitmodules
252     - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
253
254     - bash .gitlab/darwin-init.sh
255     - PATH="`pwd`/toolchain/bin:$PATH"
256   after_script:
257     - cp -Rf $HOME/.cabal cabal-cache
258   artifacts:
259     when: always
260     expire_in: 2 week
261   cache:
262     key: darwin
263     paths:
264       - cabal-cache
265       - toolchain
266
267 .validate-linux:
268   extends: .validate
269   tags:
270     - x86_64-linux
271   before_script:
272     - git clean -xdf && git submodule foreach git clean -xdf
273     - python3 .gitlab/fix-submodules.py
274     - git submodule sync --recursive
275     - git submodule update --init --recursive
276     - git checkout .gitmodules
277     - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
278       # Build hyperlinked sources for documentation when building releases
279     - |
280       if [[ -n "$CI_COMMIT_TAG" ]]; then
281         echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
282       fi
283
284     - bash .circleci/prepare-system.sh
285     # workaround for docker permissions
286     - sudo chown ghc:ghc -R .
287   after_script:
288     - cp -Rf $HOME/.cabal cabal-cache
289   cache:
290     key: linux
291     paths:
292       - cabal-cache
293       - toolchain
294
295 #################################
296 # aarch64-linux-deb9
297 #################################
298
299 .build-aarch64-linux-deb9:
300   extends: .validate-linux
301   stage: full-build
302   image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb9:$DOCKER_REV"
303   allow_failure: true
304   variables:
305     TEST_ENV: "aarch64-linux-deb9"
306     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-aarch64-linux-deb9.tar.xz"
307   cache:
308     key: linux-aarch64-deb9
309   tags:
310     - aarch64-linux
311
312 validate-aarch64-linux-deb9:
313   extends: .build-aarch64-linux-deb9
314   artifacts:
315     when: always
316     expire_in: 2 week
317
318 nightly-aarch64-linux-deb9:
319   extends: .build-aarch64-linux-deb9
320   artifacts:
321     expire_in: 2 year
322   variables:
323     TEST_TYPE: slowtest
324   only:
325     variables:
326       - $NIGHTLY
327
328 #################################
329 # i386-linux-deb9
330 #################################
331
332 .build-i386-linux-deb9:
333   extends: .validate-linux
334   stage: full-build
335   image: "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb9:$DOCKER_REV"
336   variables:
337     TEST_ENV: "i386-linux-deb9"
338     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-i386-deb9-linux.tar.xz"
339   cache:
340     key: linux-i386-deb9
341
342 validate-i386-linux-deb9:
343   extends: .build-i386-linux-deb9
344   artifacts:
345     when: always
346     expire_in: 2 week
347
348 nightly-i386-linux-deb9:
349   extends: .build-i386-linux-deb9
350   variables:
351     TEST_TYPE: slowtest
352   artifacts:
353     when: always
354     expire_in: 2 week
355   only:
356     variables:
357       - $NIGHTLY
358
359 #################################
360 # x86_64-linux-deb9
361 #################################
362
363 .build-x86_64-linux-deb9:
364   extends: .validate-linux
365   stage: full-build
366   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
367   variables:
368     TEST_ENV: "x86_64-linux-deb9"
369     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-deb9-linux.tar.xz"
370   cache:
371     key: linux-x86_64-deb9
372
373 validate-x86_64-linux-deb9:
374   extends: .build-x86_64-linux-deb9
375   artifacts:
376     when: always
377     expire_in: 2 week
378
379 nightly-x86_64-linux-deb9:
380   extends: .build-x86_64-linux-deb9
381   artifacts:
382     expire_in: 2 year
383   variables:
384     TEST_TYPE: slowtest
385   only:
386     variables:
387       - $NIGHTLY
388
389 # N.B. Has DEBUG assertions enabled in stage2
390 validate-x86_64-linux-deb9-debug:
391   extends: .build-x86_64-linux-deb9
392   stage: build
393   variables:
394     BUILD_FLAVOUR: validate
395     TEST_ENV: "x86_64-linux-deb9-debug"
396
397 validate-x86_64-linux-deb9-llvm:
398   extends: .build-x86_64-linux-deb9
399   stage: full-build
400   variables:
401     BUILD_FLAVOUR: perf-llvm
402     TEST_ENV: "x86_64-linux-deb9-llvm"
403
404 validate-x86_64-linux-deb9-integer-simple:
405   extends: .build-x86_64-linux-deb9
406   stage: full-build
407   variables:
408     INTEGER_LIBRARY: integer-simple
409     TEST_ENV: "x86_64-linux-deb9-integer-simple"
410     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-deb9-linux-integer-simple.tar.xz"
411
412 nightly-x86_64-linux-deb9-integer-simple:
413   extends: .build-x86_64-linux-deb9
414   stage: full-build
415   variables:
416     INTEGER_LIBRARY: integer-simple
417     TEST_ENV: "x86_64-linux-deb9-integer-simple"
418     TEST_TYPE: slowtest
419   artifacts:
420     expire_in: 2 year
421   only:
422     variables:
423       - $NIGHTLY
424
425 validate-x86_64-linux-deb9-unreg:
426   extends: .build-x86_64-linux-deb9
427   stage: full-build
428   variables:
429     CONFIGURE_ARGS: --enable-unregisterised
430     TEST_ENV: "x86_64-linux-deb9-unreg"
431
432
433 #################################
434 # x86_64-linux-deb8
435 #################################
436
437 release-x86_64-linux-deb8:
438   extends: .validate-linux
439   stage: full-build
440   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV"
441   variables:
442     TEST_ENV: "x86_64-linux-deb8"
443     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-deb8-linux.tar.xz"
444   only:
445     - tags
446   cache:
447     key: linux-x86_64-deb8
448   artifacts:
449     when: always
450     expire_in: 2 week
451
452
453 #################################
454 # x86_64-linux-fedora27
455 #################################
456
457 validate-x86_64-linux-fedora27:
458   extends: .validate-linux
459   stage: full-build
460   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora27:$DOCKER_REV"
461   variables:
462     TEST_ENV: "x86_64-linux-fedora27"
463     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-fedora27-linux.tar.xz"
464   cache:
465     key: linux-x86_64-fedora27
466   artifacts:
467     when: always
468     expire_in: 2 week
469
470 ############################################################
471 # Validation via Pipelines (Windows)
472 ############################################################
473
474 .build-windows:
475   <<: *only-default
476   before_script:
477     - git clean -xdf
478     - git submodule foreach git clean -xdf
479
480     # Use a local temporary directory to ensure that concurrent builds don't
481     # interfere with one another
482     - |
483       mkdir tmp
484       set TMP=%cd%\tmp
485       set TEMP=%cd%\tmp
486
487     - set PATH=C:\msys64\usr\bin;%PATH%
488     - python .gitlab/fix-submodules.py
489     - git submodule sync --recursive
490     - git submodule update --init --recursive
491     - git checkout .gitmodules
492     - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
493     - bash .gitlab/win32-init.sh
494   after_script:
495     - rd /s /q tmp
496     - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache
497     - bash -c 'make clean || true'
498   dependencies: []
499   variables:
500     FORCE_SYMLINKS: 1
501     LANG: "en_US.UTF-8"
502   cache:
503     paths:
504       - cabal-cache
505       - ghc-8.6.2
506       - ghc-tarballs
507
508 .build-windows-hadrian:
509   extends: .build-windows
510   stage: full-build
511   variables:
512     GHC_VERSION: "8.6.2"
513   script:
514     - |
515       python boot
516       bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
517     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --docs=no-sphinx binary-dist"
518     - mv _build/bindist/ghc*.tar.xz ghc.tar.xz
519     # FIXME: Testsuite disabled due to #16156.
520     # - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
521   tags:
522     - x86_64-windows
523   artifacts:
524     when: always
525     paths:
526       - ghc.tar.xz
527
528 validate-x86_64-windows-hadrian:
529   extends: .build-windows-hadrian
530   variables:
531     MSYSTEM: MINGW64
532   cache:
533     key: "x86_64-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
534
535 nightly-i386-windows-hadrian:
536   extends: .build-windows-hadrian
537   variables:
538     MSYSTEM: MINGW32
539   only:
540     variables:
541       - $NIGHTLY
542   cache:
543     key: "i386-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
544
545 .build-windows-make:
546   extends: .build-windows
547   stage: full-build
548   # due to #16084
549   allow_failure: true
550   variables:
551     BUILD_FLAVOUR: "quick"
552     GHC_VERSION: "8.6.2"
553     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-mingw32.tar.xz"
554   script:
555     - |
556       python boot
557       bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex $CONFIGURE_ARGS'
558     - bash -c "echo include mk/flavours/${BUILD_FLAVOUR}.mk > mk/build.mk"
559     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
560     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make binary-dist TAR_COMP_OPTS=-1"
561     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
562   tags:
563     - x86_64-windows
564   artifacts:
565     when: always
566     expire_in: 2 week
567     reports:
568       junit: junit.xml
569     paths:
570       - ghc-*.tar.xz
571       - junit.xml
572
573 validate-x86_64-windows:
574   extends: .build-windows-make
575   variables:
576     MSYSTEM: MINGW64
577     CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
578   cache:
579     key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
580
581 # Normal Windows validate builds are profiled; that won't do for releases.
582 release-x86_64-windows:
583   extends: validate-x86_64-windows
584   variables:
585     MSYSTEM: MINGW64
586     BUILD_FLAVOUR: "perf"
587     CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
588   only:
589     - tags
590
591 release-i386-windows:
592   extends: .build-windows-make
593   only:
594     - tags
595   variables:
596     MSYSTEM: MINGW32
597     BUILD_FLAVOUR: "perf"
598     CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
599   cache:
600     key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
601
602 nightly-i386-windows:
603   extends: .build-windows-make
604   only:
605     variables:
606       - $NIGHTLY
607   variables:
608     MSYSTEM: MINGW32
609     CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
610   cache:
611     key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
612
613 ############################################################
614 # Cleanup
615 ############################################################
616
617 # Note [Cleaning up after shell executor]
618 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
619 #
620 # As noted in [1], gitlab-runner's shell executor doesn't clean up its working
621 # directory after builds. Unfortunately, we are forced to use the shell executor
622 # on Windows. To avoid running out of disk space we add a stage at the end of
623 # the build to remove the \GitLabRunner\builds directory. Since we only run a
624 # single build at a time on Windows this should be safe.
625 #
626 # [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
627
628 # See Note [Cleanup after shell executor]
629 cleanup-windows:
630   <<: *only-default
631   stage: cleanup
632   tags:
633     - x86_64-windows
634   when: always
635   dependencies: []
636   before_script:
637     - echo "Time to clean up"
638   script:
639     - echo "Let's go"
640   after_script:
641     - set "BUILD_DIR=%CI_PROJECT_DIR%"
642     - set "BUILD_DIR=%BUILD_DIR:/=\%"
643     - echo "Cleaning %BUILD_DIR%"
644     - cd \GitLabRunner
645     # This is way more complicated than it should be:
646     # See https://stackoverflow.com/questions/1965787
647     - del %BUILD_DIR%\* /F /Q
648     - for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p"
649     - exit /b 0
650
651 # See Note [Cleanup after shell executor]
652 cleanup-darwin:
653   <<: *only-default
654   stage: cleanup
655   tags:
656     - x86_64-darwin
657   when: always
658   dependencies: []
659   before_script:
660     - echo "Time to clean up"
661   script:
662     - echo "Let's go"
663   after_script:
664     - BUILD_DIR=$CI_PROJECT_DIR
665     - echo "Cleaning $BUILD_DIR"
666     - cd $HOME
667     - rm -Rf $BUILD_DIR/*
668     - exit 0
669
670 ############################################################
671 # Packaging
672 ############################################################
673
674 doc-tarball:
675   <<: *only-default
676   stage: packaging
677   tags:
678     - x86_64-linux
679   image: ghcci/x86_64-linux-deb9:0.2
680   dependencies:
681     - validate-x86_64-linux-deb9
682     - validate-x86_64-windows
683   artifacts:
684     paths:
685       - haddock.html.tar.xz
686       - libraries.html.tar.xz
687       - users_guide.html.tar.xz
688       - index.html
689       - "*.pdf"
690   script:
691     - rm -Rf docs
692     - bash -ex distrib/mkDocs/mkDocs ghc-x86_64-deb9-linux.tar.xz ghc-x86_64-mingw32.tar.xz
693     - ls -lh
694     - mv docs/*.tar.xz docs/index.html .
695
696 source-tarball:
697   stage: packaging
698   tags:
699     - x86_64-linux
700   image: ghcci/x86_64-linux-deb9:0.2
701   only:
702     - tags
703   artifacts:
704     paths:
705       - ghc-*.tar.xz
706       - version
707   script:
708     - mk/get-win32-tarballs.sh download all
709     - ./boot
710     - ./configure
711     - make sdist
712     - mv sdistprep/*.xz  .
713     - make show VALUE=version > version
714
715
716 ############################################################
717 # Testing via head.hackage
718 ############################################################
719
720 # Triggering jobs in the ghc/head.hackage project requires that we have a job
721 # token for that repository. Furthermore the head.hackage CI job must have
722 # access to an unprivileged access token with the ability to query the ghc/ghc
723 # project such that it can find the job ID of the fedora27 job for the current
724 # pipeline.
725
726 .hackage:
727   <<: *only-default
728   stage: hackage
729   image: ghcci/x86_64-linux-deb9:0.2
730   tags:
731     - x86_64-linux
732   dependencies: []
733   variables:
734     HEAD_HACKAGE_PROJECT_ID: "78"
735   script:
736     - bash .gitlab/start-head.hackage.sh
737
738 hackage:
739   extends: .hackage
740   when: manual
741
742 hackage-label:
743   extends: .hackage
744   only:
745     variables:
746       - $CI_MERGE_REQUEST_LABELS =~ /.*user-facing.*/
747
748 nightly-hackage:
749   extends: .hackage
750   only:
751     variables:
752       - $NIGHTLY
753
754 pages:
755   stage: deploy
756   dependencies:
757     - doc-tarball
758   image: ghcci/x86_64-linux-deb9:0.2
759   tags:
760     - x86_64-linux
761   script:
762     - mkdir -p public/doc
763     - tar -xf haddock.html.tar.xz -C public/doc
764     - tar -xf libraries.html.tar.xz -C public/doc
765     - tar -xf users_guide.html.tar.xz -C public/doc
766     - cp -f index.html public/doc
767   only:
768     - master
769   artifacts:
770     paths:
771       - public