Fix header locations
[ghc.git] / .gitlab-ci.yml
1 variables:
2   GIT_SSL_NO_VERIFY: "1"
3   # Commit of ghc/ci-images repository from which to pull Docker images
4   DOCKER_REV: 6d19c3adc1f5c28c82aed8c5b1ac40931ac60f3f
5
6 before_script:
7   - python3 .gitlab/fix-submodules.py
8   - git submodule sync --recursive
9   - git submodule update --init --recursive
10   - git checkout .gitmodules
11
12 stages:
13   - lint
14   - build
15   - full-build
16
17 ############################################################
18 # Runner Tags
19 ############################################################
20 #
21 # * x86_64-linux: Any Docker-capable x86_64 Linux machine
22 # * aarch64-linux: Any Docker-capable AArch64 Linux machine
23 # * x86_64-windows: A x86_64 Windows machine
24 # * lint: Any Docker-capable x86_64 Linux machine; distinct from
25 #         x86_64-linux to ensure low-latency availability.
26 #
27
28
29 ############################################################
30 # Linting
31 ############################################################
32
33 ghc-linters:
34   stage: lint
35   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
36   script:
37     - |
38       if [ -n "$CI_MERGE_REQUEST_ID" ]; then
39         base="$(git merge-base $CI_MERGE_REQUEST_BRANCH_NAME HEAD)"
40         validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
41         submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
42         validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
43         .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
44         .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
45       fi
46   tags:
47     - lint
48
49 ############################################################
50 # Validation via Pipelines (hadrian)
51 ############################################################
52
53 .validate-hadrian:
54   allow_failure: true
55   script:
56     - git clean -xdf && git submodule foreach git clean -xdf
57     - bash .circleci/prepare-system.sh
58     - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
59     - ./boot
60     - ./configure $CONFIGURE_ARGS
61     - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh`
62   cache:
63     key: hadrian
64     paths:
65       - cabal-cache
66
67 validate-x86_64-linux-deb8-hadrian:
68   extends: .validate-hadrian
69   stage: build
70   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV"
71   before_script:
72     # workaround for docker permissions
73     - sudo chown ghc:ghc -R .
74     - python3 .gitlab/fix-submodules.py
75     - git submodule sync --recursive
76     - git submodule update --init --recursive
77     - git checkout .gitmodules
78   tags:
79     - x86_64-linux
80
81 ############################################################
82 # Validation via Pipelines (make)
83 ############################################################
84
85 .validate:
86   variables:
87     TEST_TYPE: test
88   before_script:
89     - git clean -xdf && git submodule foreach git clean -xdf
90   script:
91     - ./boot
92     - ./configure $CONFIGURE_ARGS
93     - |
94       THREADS=`mk/detect-cpu-count.sh`
95       make V=0 -j$THREADS
96     - |
97       make binary-dist TAR_COMP_OPTS="-1"
98       mv ghc-*.tar.xz ghc.tar.xz
99     - |
100       THREADS=`mk/detect-cpu-count.sh`
101       make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml SKIP_PERF_TESTS=YES
102   artifacts:
103     reports:
104       junit: junit.xml
105     expire_in: 2 week
106     paths:
107       - ghc.tar.xz
108       - junit.xml
109
110 validate-x86_64-darwin:
111   extends: .validate
112   stage: full-build
113   allow_failure: true
114   tags:
115     - x86_64-darwin
116   variables:
117     GHC_VERSION: 8.6.3
118     MACOSX_DEPLOYMENT_TARGET: "10.7"
119     # Only Sierra and onwards supports clock_gettime. See #12858
120     ac_cv_func_clock_gettime: "no"
121     LANG: "en_US.UTF-8"
122   before_script:
123     - git clean -xdf && git submodule foreach git clean -xdf
124     - python .gitlab/fix-submodules.py
125     - git submodule sync --recursive
126     - git submodule update --init --recursive
127     - git checkout .gitmodules
128
129     - bash .gitlab/darwin-init.sh
130     - PATH="`pwd`/toolchain/bin:$PATH"
131       # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
132     - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
133     - echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
134   after_script:
135     - cp -Rf $HOME/.cabal cabal-cache
136   artifacts:
137     when: always
138     expire_in: 2 week
139   cache:
140     key: darwin
141     paths:
142       - cabal-cache
143       - toolchain
144
145 .validate-linux:
146   extends: .validate
147   tags:
148     - x86_64-linux
149   before_script:
150     - git clean -xdf && git submodule foreach git clean -xdf
151     - python3 .gitlab/fix-submodules.py
152     - git submodule sync --recursive
153     - git submodule update --init --recursive
154     - git checkout .gitmodules
155
156     - bash .circleci/prepare-system.sh
157     # workaround for docker permissions
158     - sudo chown ghc:ghc -R .
159   after_script:
160     - cp -Rf $HOME/.cabal cabal-cache
161   cache:
162     key: linux
163     paths:
164       - cabal-cache
165       - toolchain
166
167 validate-aarch64-linux-deb9:
168   extends: .validate-linux
169   stage: full-build
170   image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb9:$DOCKER_REV"
171   allow_failure: true
172   artifacts:
173     when: always
174     expire_in: 2 week
175   cache:
176     key: linux-aarch64-deb9
177   tags:
178     - aarch64-linux
179
180 nightly-aarch64-linux-deb9:
181   extends: validate-aarch64-linux-deb9
182   stage: full-build
183   artifacts:
184     expire_in: 2 year
185   variables:
186     TEST_TYPE: slowtest
187   only:
188     variables:
189       - $NIGHTLY
190
191 validate-i386-linux-deb9:
192   extends: .validate-linux
193   stage: full-build
194   image: "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb9:$DOCKER_REV"
195   allow_failure: true
196   artifacts:
197     when: always
198     expire_in: 2 week
199   cache:
200     key: linux-i386-deb9
201
202 nightly-i386-linux-deb9:
203   extends: .validate-linux
204   stage: full-build
205   image: "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb9:$DOCKER_REV"
206   allow_failure: true
207   variables:
208     TEST_TYPE: slowtest
209   artifacts:
210     when: always
211     expire_in: 2 week
212   only:
213     variables:
214       - $NIGHTLY
215   cache:
216     key: linux-i386-deb9
217
218 validate-x86_64-linux-deb9:
219   extends: .validate-linux
220   stage: build
221   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
222   artifacts:
223     when: always
224     expire_in: 2 week
225   cache:
226     key: linux-x86_64-deb9
227
228 release-x86_64-linux-deb9-dwarf:
229   extends: .validate-linux
230   stage: build
231   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
232   allow_failure: true
233   variables:
234     CONFIGURE_ARGS: "--enable-dwarf-unwind"
235     BUILD_FLAVOUR: dwarf
236     TEST_ENV: "x86_64-linux-deb9"
237   artifacts:
238     when: always
239     expire_in: 2 week
240   cache:
241     key: linux-x86_64-deb9
242
243 nightly-x86_64-linux-deb9:
244   extends: validate-x86_64-linux-deb9
245   stage: build
246   artifacts:
247     expire_in: 2 year
248   variables:
249     TEST_TYPE: slowtest
250   only:
251     variables:
252       - $NIGHTLY
253
254 validate-x86_64-linux-deb9-llvm:
255   extends: .validate-linux
256   stage: full-build
257   allow_failure: true
258   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
259   variables:
260     BUILD_FLAVOUR: perf-llvm
261   cache:
262     key: linux-x86_64-deb9
263
264 validate-x86_64-linux-deb8:
265   extends: .validate-linux
266   stage: full-build
267   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV"
268   cache:
269     key: linux-x86_64-deb8
270   artifacts:
271     when: always
272     expire_in: 2 week
273
274 validate-x86_64-linux-fedora27:
275   extends: .validate-linux
276   stage: full-build
277   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora27:$DOCKER_REV"
278   cache:
279     key: linux-x86_64-fedora27
280   artifacts:
281     when: always
282     expire_in: 2 week
283
284 validate-x86_64-linux-deb9-integer-simple:
285   extends: .validate-linux
286   stage: full-build
287   allow_failure: true
288   variables:
289     INTEGER_LIBRARY: integer-simple
290   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
291   cache:
292     key: linux-x86_64-deb9
293
294 nightly-x86_64-linux-deb9-integer-simple:
295   extends: validate-x86_64-linux-deb9-integer-simple
296   stage: full-build
297   allow_failure: true
298   artifacts:
299     expire_in: 2 year
300   variables:
301     TEST_TYPE: slowtest
302   only:
303     variables:
304       - $NIGHTLY
305
306 validate-x86_64-linux-deb9-unreg:
307   extends: .validate-linux
308   stage: full-build
309   allow_failure: true
310   variables:
311     CONFIGURE_ARGS: --enable-unregisterised
312   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
313   cache:
314     key: linux-x86_64-deb9
315
316 ############################################################
317 # Validation via Pipelines (Windows)
318 ############################################################
319
320 .validate-windows:
321   before_script:
322     - git clean -xdf
323     - git submodule foreach git clean -xdf
324
325     # Use a local temporary directory to ensure that concurrent builds don't
326     # interfere with one another
327     - |
328       mkdir tmp
329       set TMP=%cd%\tmp
330       set TEMP=%cd%\tmp
331
332     - set PATH=C:\msys64\usr\bin;%PATH%
333     - python .gitlab/fix-submodules.py
334     - git submodule sync --recursive
335     - git submodule update --init --recursive
336     - git checkout .gitmodules
337     - bash .gitlab/win32-init.sh
338   after_script:
339     - rd /s /q tmp
340     - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache
341     - bash -c 'make clean || true'
342   cache:
343     paths:
344       - cabal-cache
345       - ghc-8.6.2
346       - ghc-tarballs
347
348 validate-x86_64-windows-hadrian:
349   extends: .validate-windows
350   stage: full-build
351   # due to #16073
352   allow_failure: true
353   variables:
354     GHC_VERSION: "8.6.2"
355     LANG: "en_US.UTF-8"
356   script:
357     - |
358       set MSYSTEM=MINGW64
359       python boot
360       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
361       mkdir -p _build
362       cp -R inplace/mingw _build/mingw
363     # FIXME: --no-lint due to #15950
364     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint"
365     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
366     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
367   cache:
368     key: x86_64-windows
369   tags:
370     - x86_64-windows
371
372 validate-x86_64-windows:
373   extends: .validate-windows
374   stage: build
375   # due to #16084
376   allow_failure: true
377   variables:
378     GHC_VERSION: "8.6.2"
379     LANG: "en_US.UTF-8"
380   script:
381     - |
382       set MSYSTEM=MINGW64
383       python boot
384       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
385     - bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
386     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
387     - |
388       bash -c "make binary-dist TAR_COMP_OPTS=-1"
389       mv ghc-*.tar.xz ghc.tar.xz
390     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
391   cache:
392     key: x86_64-windows
393   tags:
394     - x86_64-windows
395   artifacts:
396     when: always
397     reports:
398       junit: junit.xml
399     paths:
400       - ghc.tar.xz
401       - junit.xml
402