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