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