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