gitlab-ci: Add i386 Debian 9 builds
[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 # 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
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   script:
87     - git clean -xdf
88     - ./boot
89     - ./configure $CONFIGURE_ARGS
90     - |
91       THREADS=`mk/detect-cpu-count.sh`
92       make V=0 -j$THREADS
93     - |
94       make binary-dist TAR_COMP_OPTS="-1"
95       mv ghc-*.tar.xz ghc.tar.xz
96     - |
97       THREADS=`mk/detect-cpu-count.sh`
98       make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml
99   artifacts:
100     reports:
101       junit: junit.xml
102     expire_in: 2 week
103     paths:
104       - ghc.tar.xz
105       - junit.xml
106
107 validate-x86_64-darwin:
108   extends: .validate
109   stage: full-build
110   allow_failure: true
111   tags:
112     - x86_64-darwin
113   variables:
114     GHC_VERSION: 8.6.3
115     MACOSX_DEPLOYMENT_TARGET: "10.7"
116     # Only Sierra and onwards supports clock_gettime. See #12858
117     ac_cv_func_clock_gettime: "no"
118     LANG: "en_US.UTF-8"
119   before_script:
120     - python .gitlab/fix-submodules.py
121     - git submodule sync --recursive
122     - git submodule update --init --recursive
123     - git checkout .gitmodules
124
125     - bash .gitlab/darwin-init.sh
126     - PATH="`pwd`/toolchain/bin:$PATH"
127       # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
128     - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
129     - echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
130   after_script:
131     - cp -Rf $HOME/.cabal cabal-cache
132   artifacts:
133     when: always
134     expire_in: 2 week
135   cache:
136     key: darwin
137     paths:
138       - cabal-cache
139       - toolchain
140
141 .validate-linux:
142   extends: .validate
143   tags:
144     - x86_64-linux
145   before_script:
146     - python3 .gitlab/fix-submodules.py
147     - git submodule sync --recursive
148     - git submodule update --init --recursive
149     - git checkout .gitmodules
150
151     - bash .circleci/prepare-system.sh
152     # workaround for docker permissions
153     - sudo chown ghc:ghc -R .
154   after_script:
155     - cp -Rf $HOME/.cabal cabal-cache
156   cache:
157     key: linux
158     paths:
159       - cabal-cache
160       - toolchain
161
162 validate-aarch64-linux-deb9:
163   extends: .validate-linux
164   stage: full-build
165   image: ghcci/aarch64-linux-deb9:0.1
166   allow_failure: true
167   artifacts:
168     when: always
169     expire_in: 2 week
170   cache:
171     key: linux-aarch64-deb9
172   tags:
173     - aarch64-linux
174
175 nightly-aarch64-linux-deb9:
176   extends: validate-aarch64-linux-deb9
177   stage: full-build
178   artifacts:
179     expire_in: 2 year
180   variables:
181     TEST_TYPE: slowtest
182   only:
183     variables:
184       - $NIGHTLY
185
186 validate-i386-linux-deb9:
187   extends: .validate-linux
188   stage: full-build
189   image: ghcci/i386-linux-deb9:0.1
190   allow_failure: true
191   artifacts:
192     when: always
193     expire_in: 2 week
194   cache:
195     key: linux-i386-deb9
196
197 nightly-i386-linux-deb9:
198   extends: .validate-linux
199   stage: full-build
200   image: ghcci/i386-linux-deb9:0.1
201   allow_failure: true
202   variables:
203     TEST_TYPE: slowtest
204   artifacts:
205     when: always
206     expire_in: 2 week
207   cache:
208     key: linux-i386-deb9
209
210 validate-x86_64-linux-deb9:
211   extends: .validate-linux
212   stage: build
213   image: ghcci/x86_64-linux-deb9:0.2
214   artifacts:
215     when: always
216     expire_in: 2 week
217   cache:
218     key: linux-x86_64-deb9
219
220 nightly-x86_64-linux-deb9:
221   extends: validate-x86_64-linux-deb9
222   stage: build
223   artifacts:
224     expire_in: 2 year
225   variables:
226     TEST_TYPE: slowtest
227   only:
228     variables:
229       - $NIGHTLY
230
231 validate-x86_64-linux-deb9-llvm:
232   extends: .validate-linux
233   stage: full-build
234   allow_failure: true
235   image: ghcci/x86_64-linux-deb9:0.2
236   variables:
237     BUILD_FLAVOUR: perf-llvm
238   cache:
239     key: linux-x86_64-deb9
240
241 validate-x86_64-linux-deb8:
242   extends: .validate-linux
243   stage: full-build
244   image: ghcci/x86_64-linux-deb8:0.1
245   cache:
246     key: linux-x86_64-deb8
247   artifacts:
248     when: always
249     expire_in: 2 week
250
251 validate-x86_64-linux-fedora27:
252   extends: .validate-linux
253   stage: full-build
254   image: ghcci/x86_64-linux-fedora27:0.1
255   cache:
256     key: linux-x86_64-fedora27
257   artifacts:
258     when: always
259     expire_in: 2 week
260
261 validate-x86_64-linux-deb9-integer-simple:
262   extends: .validate-linux
263   stage: full-build
264   allow_failure: true
265   variables:
266     INTEGER_LIBRARY: integer-simple
267   image: ghcci/x86_64-linux-deb9:0.2
268   cache:
269     key: linux-x86_64-deb9
270
271 nightly-x86_64-linux-deb9-integer-simple:
272   extends: validate-x86_64-linux-deb9-integer-simple
273   stage: full-build
274   artifacts:
275     expire_in: 2 year
276   variables:
277     TEST_TYPE: slowtest
278   only:
279     variables:
280       - $NIGHTLY
281
282 validate-x86_64-linux-deb9-unreg:
283   extends: .validate-linux
284   stage: full-build
285   variables:
286     CONFIGURE_ARGS: --enable-unregisterised
287   image: ghcci/x86_64-linux-deb9:0.2
288   cache:
289     key: linux-x86_64-deb9
290
291 ############################################################
292 # Validation via Pipelines (Windows)
293 ############################################################
294
295 .validate-windows:
296   before_script:
297     - git clean -xdf
298     - PATH=C:\msys64\usr\bin;%PATH%
299     - python .gitlab/fix-submodules.py
300     - git submodule sync --recursive
301     - git submodule update --init --recursive
302     - git checkout .gitmodules
303     - bash .gitlab/win32-init.sh
304   cache:
305     paths:
306       - cabal-cache
307       - ghc-8.6.2
308       - ghc-tarballs
309
310 validate-x86_64-windows-hadrian:
311   extends: .validate-windows
312   stage: full-build
313   variables:
314     GHC_VERSION: "8.6.2"
315     LANG: "en_US.UTF-8"
316   # due to #16073
317   allow_failure: true
318   script:
319     - |
320       set MSYSTEM=MINGW64
321       python boot
322       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
323       mkdir -p _build
324       cp -R inplace/mingw _build/mingw
325     # FIXME: --no-lint due to #15950
326     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint"
327     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
328     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
329     - cp -Rf $APPDATA/cabal cabal-cache
330   cache:
331     key: x86_64-windows
332   tags:
333     - x86_64-windows
334
335 validate-x86_64-windows:
336   extends: .validate-windows
337   stage: full-build
338   variables:
339     GHC_VERSION: "8.6.2"
340     LANG: "en_US.UTF-8"
341   script:
342     - |
343       set MSYSTEM=MINGW64
344       python boot
345       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
346     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
347     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
348     - cp -Rf $APPDATA/cabal cabal-cache
349   cache:
350     key: x86_64-windows
351   tags:
352     - x86_64-windows
353
354 ############################################################
355 # Validation via CircleCI
356 ############################################################
357
358 .circleci:
359   stage: build
360   image: ghcci/x86_64-linux-deb8:0.1
361   artifacts:
362     when: always
363     expire_in: 2 week
364     reports:
365       junit: junit.xml
366     paths:
367       - ghc.tar.xz
368       - junit.xml
369   tags:
370     - circleci
371
372 # All validation jobs keep the bindists and test results are artifacts,
373 # when we get far enough to generate them.
374 #
375 # This requires updating the maximum artifacts size limit in Gitlab to
376 # something like 200MB.
377
378 circleci-validate-x86_64-darwin:
379   extends: .circleci
380   script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"