Check that libs found by GCC aren't folders
[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     - python3 .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     - 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     - git clean -xdf && git submodule foreach git clean -xdf
147     - python3 .gitlab/fix-submodules.py
148     - git submodule sync --recursive
149     - git submodule update --init --recursive
150     - git checkout .gitmodules
151
152     - bash .circleci/prepare-system.sh
153     # workaround for docker permissions
154     - sudo chown ghc:ghc -R .
155   after_script:
156     - cp -Rf $HOME/.cabal cabal-cache
157   cache:
158     key: linux
159     paths:
160       - cabal-cache
161       - toolchain
162
163 validate-aarch64-linux-deb9:
164   extends: .validate-linux
165   stage: full-build
166   image: ghcci/aarch64-linux-deb9:0.1
167   allow_failure: true
168   artifacts:
169     when: always
170     expire_in: 2 week
171   cache:
172     key: linux-aarch64-deb9
173   tags:
174     - aarch64-linux
175
176 nightly-aarch64-linux-deb9:
177   extends: validate-aarch64-linux-deb9
178   stage: full-build
179   artifacts:
180     expire_in: 2 year
181   variables:
182     TEST_TYPE: slowtest
183   only:
184     variables:
185       - $NIGHTLY
186
187 validate-i386-linux-deb9:
188   extends: .validate-linux
189   stage: full-build
190   image: ghcci/i386-linux-deb9:0.1
191   allow_failure: true
192   artifacts:
193     when: always
194     expire_in: 2 week
195   cache:
196     key: linux-i386-deb9
197
198 nightly-i386-linux-deb9:
199   extends: .validate-linux
200   stage: full-build
201   image: ghcci/i386-linux-deb9:0.1
202   allow_failure: true
203   variables:
204     TEST_TYPE: slowtest
205   artifacts:
206     when: always
207     expire_in: 2 week
208   only:
209     variables:
210       - $NIGHTLY
211   cache:
212     key: linux-i386-deb9
213
214 validate-x86_64-linux-deb9:
215   extends: .validate-linux
216   stage: build
217   image: ghcci/x86_64-linux-deb9:0.2
218   artifacts:
219     when: always
220     expire_in: 2 week
221   cache:
222     key: linux-x86_64-deb9
223
224 nightly-x86_64-linux-deb9:
225   extends: validate-x86_64-linux-deb9
226   stage: build
227   artifacts:
228     expire_in: 2 year
229   variables:
230     TEST_TYPE: slowtest
231   only:
232     variables:
233       - $NIGHTLY
234
235 validate-x86_64-linux-deb9-llvm:
236   extends: .validate-linux
237   stage: full-build
238   allow_failure: true
239   image: ghcci/x86_64-linux-deb9:0.2
240   variables:
241     BUILD_FLAVOUR: perf-llvm
242   cache:
243     key: linux-x86_64-deb9
244
245 validate-x86_64-linux-deb8:
246   extends: .validate-linux
247   stage: full-build
248   image: ghcci/x86_64-linux-deb8:0.1
249   cache:
250     key: linux-x86_64-deb8
251   artifacts:
252     when: always
253     expire_in: 2 week
254
255 validate-x86_64-linux-fedora27:
256   extends: .validate-linux
257   stage: full-build
258   image: ghcci/x86_64-linux-fedora27:0.1
259   cache:
260     key: linux-x86_64-fedora27
261   artifacts:
262     when: always
263     expire_in: 2 week
264
265 validate-x86_64-linux-deb9-integer-simple:
266   extends: .validate-linux
267   stage: full-build
268   variables:
269     INTEGER_LIBRARY: integer-simple
270   image: ghcci/x86_64-linux-deb9:0.2
271   cache:
272     key: linux-x86_64-deb9
273
274 nightly-x86_64-linux-deb9-integer-simple:
275   extends: validate-x86_64-linux-deb9-integer-simple
276   stage: full-build
277   artifacts:
278     expire_in: 2 year
279   variables:
280     TEST_TYPE: slowtest
281   only:
282     variables:
283       - $NIGHTLY
284
285 validate-x86_64-linux-deb9-unreg:
286   extends: .validate-linux
287   stage: full-build
288   variables:
289     CONFIGURE_ARGS: --enable-unregisterised
290   image: ghcci/x86_64-linux-deb9:0.2
291   cache:
292     key: linux-x86_64-deb9
293
294 ############################################################
295 # Validation via Pipelines (Windows)
296 ############################################################
297
298 .validate-windows:
299   before_script:
300     - git clean -xdf
301     - git submodule foreach git clean -xdf
302
303     # Use a local temporary directory to ensure that concurrent builds don't
304     # interfere with one another
305     - |
306       mkdir tmp
307       set TMP=%cd%\tmp
308       set TEMP=%cd%\tmp
309
310     - set PATH=C:\msys64\usr\bin;%PATH%
311     - python .gitlab/fix-submodules.py
312     - git submodule sync --recursive
313     - git submodule update --init --recursive
314     - git checkout .gitmodules
315     - bash .gitlab/win32-init.sh
316   after_script:
317     - rd /s /q tmp
318     - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache
319     - bash -c 'make clean || true'
320   cache:
321     paths:
322       - cabal-cache
323       - ghc-8.6.2
324       - ghc-tarballs
325
326 validate-x86_64-windows-hadrian:
327   extends: .validate-windows
328   stage: full-build
329   # due to #16073
330   allow_failure: true
331   variables:
332     GHC_VERSION: "8.6.2"
333     LANG: "en_US.UTF-8"
334   script:
335     - |
336       set MSYSTEM=MINGW64
337       python boot
338       bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
339       mkdir -p _build
340       cp -R inplace/mingw _build/mingw
341     # FIXME: --no-lint due to #15950
342     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint"
343     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
344     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
345   cache:
346     key: x86_64-windows
347   tags:
348     - x86_64-windows
349
350 validate-x86_64-windows:
351   extends: .validate-windows
352   stage: full-build
353   # due to #16084
354   allow_failure: true
355   variables:
356     GHC_VERSION: "8.6.2"
357     LANG: "en_US.UTF-8"
358   script:
359     - |
360       set MSYSTEM=MINGW64
361       python boot
362       bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
363     - bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
364     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
365     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
366   cache:
367     key: x86_64-windows
368   tags:
369     - x86_64-windows
370
371 ############################################################
372 # Validation via CircleCI
373 ############################################################
374
375 .circleci:
376   stage: build
377   image: ghcci/x86_64-linux-deb8:0.1
378   artifacts:
379     when: always
380     expire_in: 2 week
381     reports:
382       junit: junit.xml
383     paths:
384       - ghc.tar.xz
385       - junit.xml
386   tags:
387     - circleci
388
389 # All validation jobs keep the bindists and test results are artifacts,
390 # when we get far enough to generate them.
391 #
392 # This requires updating the maximum artifacts size limit in Gitlab to
393 # something like 200MB.
394
395 .circleci-validate-x86_64-darwin:
396   extends: .circleci
397   stage: full-build
398   allow_failure: true
399   script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"