gitlab: Drop submodules hack
[ghc.git] / .gitlab-ci.yml
1 variables:
2   GIT_SSL_NO_VERIFY: "1"
3   GIT_SUBMODULES_STRATEGY: "recursive"
4
5 stages:
6   - lint
7   - build
8
9 ############################################################
10 # Linting
11 ############################################################
12
13 ghc-linters:
14   stage: lint
15   image: ghcci/linters:0.1
16   script:
17     - |
18       if [ -n "$CI_MERGE_REQUEST_ID" ]; then
19         base="$(git merge-base $CI_MERGE_REQUEST_BRANCH_NAME HEAD)"
20         validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
21         submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
22         validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
23         .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
24         .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
25       fi
26
27 ############################################################
28 # Validation via Pipelines (hadrian)
29 ############################################################
30
31 .validate-hadrian:
32   stage: build
33   allow_failure: true
34   script:
35     - bash .circleci/prepare-system.sh
36     - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
37     - ./boot
38     - ./configure $CONFIGURE_ARGS
39     - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh`
40   cache:
41     key: hadrian
42     paths:
43       - cabal-cache
44
45 validate-x86_64-linux-deb8-hadrian:
46   extends: .validate-hadrian
47   image: ghcci/x86_64-linux-deb8:0.1
48   before_script:
49     # workaround for docker permissions
50     - sudo chown ghc:ghc -R .
51   tags:
52     - x86_64-linux
53
54 ############################################################
55 # Validation via Pipelines (make)
56 ############################################################
57
58 .validate:
59   stage: build
60   variables:
61     TEST_TYPE: test
62   script:
63     - make clean || true
64     - ./boot
65     - ./configure $CONFIGURE_ARGS
66     - |
67       THREADS=`mk/detect-cpu-count.sh`
68       make V=0 -j$THREADS
69     - |
70       make binary-dist TAR_COMP_OPTS="-1"
71       mv ghc-*.tar.xz ghc.tar.xz
72     - |
73       THREADS=`mk/detect-cpu-count.sh`
74       make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml
75   artifacts:
76     reports:
77       junit: junit.xml
78     expire_in: 2 week
79     paths:
80       - ghc.tar.xz
81       - junit.xml
82
83 validate-x86_64-darwin:
84   extends: .validate
85   allow_failure: true
86   tags:
87     - x86_64-darwin
88   variables:
89     GHC_VERSION: 8.6.3
90     MACOSX_DEPLOYMENT_TARGET: "10.7"
91     # Only Sierra and onwards supports clock_gettime. See #12858
92     ac_cv_func_clock_gettime: "no"
93   before_script:
94     - bash .gitlab/darwin-init.sh
95     - PATH="`pwd`/toolchain/bin:$PATH"
96       # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
97     - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
98   after_script:
99     - cp -Rf $HOME/.cabal cabal-cache
100   artifacts:
101     when: always
102     expire_in: 2 week
103   cache:
104     key: darwin
105     paths:
106       - cabal-cache
107       - toolchain
108
109 .validate-linux:
110   extends: .validate
111   tags:
112     - x86_64-linux
113   before_script:
114     - bash .circleci/prepare-system.sh
115     # workaround for docker permissions
116     - sudo chown ghc:ghc -R .
117   after_script:
118     - cp -Rf $HOME/.cabal cabal-cache
119   cache:
120     key: linux
121     paths:
122       - cabal-cache
123       - toolchain
124
125 validate-aarch64-linux-deb9:
126   extends: .validate-linux
127   image: ghcci/aarch64-linux-deb9:0.1
128   allow_failure: true
129   artifacts:
130     when: always
131     expire_in: 2 week
132   cache:
133     key: linux-aarch64-deb9
134   tags:
135     - aarch64-linux
136
137 nightly-aarch64-linux-deb9:
138   extends: validate-aarch64-linux-deb9
139   artifacts:
140     expire_in: 2 year
141   variables:
142     TEST_TYPE: slowtest
143   only:
144     variables:
145       - $NIGHTLY
146
147 validate-x86_64-linux-deb9:
148   extends: .validate-linux
149   image: ghcci/x86_64-linux-deb9:0.2
150   artifacts:
151     when: always
152     expire_in: 2 week
153   cache:
154     key: linux-x86_64-deb9
155
156 nightly-x86_64-linux-deb9:
157   extends: validate-x86_64-linux-deb9
158   artifacts:
159     expire_in: 2 year
160   variables:
161     TEST_TYPE: slowtest
162   only:
163     variables:
164       - $NIGHTLY
165
166 validate-x86_64-linux-deb9-llvm:
167   extends: .validate-linux
168   allow_failure: true
169   image: ghcci/x86_64-linux-deb9:0.2
170   variables:
171     BUILD_FLAVOUR: perf-llvm
172   cache:
173     key: linux-x86_64-deb9
174
175 validate-x86_64-linux-deb8:
176   extends: .validate-linux
177   image: ghcci/x86_64-linux-deb8:0.1
178   cache:
179     key: linux-x86_64-deb8
180   artifacts:
181     when: always
182     expire_in: 2 week
183
184 validate-x86_64-linux-fedora27:
185   extends: .validate-linux
186   image: ghcci/x86_64-linux-fedora27:0.1
187   cache:
188     key: linux-x86_64-fedora27
189   artifacts:
190     when: always
191     expire_in: 2 week
192
193 validate-x86_64-linux-deb9-integer-simple:
194   extends: .validate-linux
195   allow_failure: true
196   variables:
197     INTEGER_LIBRARY: integer-simple
198   image: ghcci/x86_64-linux-deb9:0.2
199   cache:
200     key: linux-x86_64-deb9
201
202 nightly-x86_64-linux-deb9-integer-simple:
203   extends: validate-x86_64-linux-deb9-integer-simple
204   artifacts:
205     expire_in: 2 year
206   variables:
207     TEST_TYPE: slowtest
208   only:
209     variables:
210       - $NIGHTLY
211
212 validate-x86_64-linux-deb9-unreg:
213   extends: .validate-linux
214   variables:
215     CONFIGURE_ARGS: --enable-unregisterised
216   image: ghcci/x86_64-linux-deb9:0.2
217   cache:
218     key: linux-x86_64-deb9
219
220 ############################################################
221 # Validation via Pipelines (Windows)
222 ############################################################
223
224 validate-x86_64-windows-hadrian:
225   stage: build
226   variables:
227     GHC_VERSION: "8.6.2"
228   script:
229     - bash -e .gitlab/win32-init.sh
230     - |
231       set MSYSTEM=MINGW64
232       python boot
233       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
234       mkdir -p _build
235       cp -R inplace/mingw _build/mingw
236     # FIXME: --no-lint due to #15950
237     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint"
238     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
239     - mv ghc-*.tar.xz ghc.tar.xz
240     - bash -c 'make V=0 -j`mk/detect-cpu-count.sh` HADDOCK_DOCS=NO test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
241     - cp -Rf $APPDATA/cabal cabal-cache
242   cache:
243     key: windows-hadrian
244     paths:
245       - cabal-cache
246       - ghc-8.6.2
247       - ghc-tarballs
248   tags:
249     - x86_64-windows
250
251 validate-x86_64-windows:
252   stage: build
253   variables:
254     GHC_VERSION: "8.6.2"
255   script:
256     - bash -e .gitlab/win32-init.sh
257     - |
258       set MSYSTEM=MINGW64
259       python boot
260       bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
261     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
262     - mv ghc-*.tar.xz ghc.tar.xz
263     - bash -c 'make V=0 -j`mk/detect-cpu-count.sh` HADDOCK_DOCS=NO test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
264     - cp -Rf $APPDATA/cabal cabal-cache
265   cache:
266     key: windows
267     paths:
268       - cabal-cache
269       - ghc-8.6.2
270       - ghc-tarballs
271   tags:
272     - x86_64-windows
273
274 ############################################################
275 # Validation via CircleCI
276 ############################################################
277
278 .circleci:
279   stage: build
280   image: ghcci/x86_64-linux-deb8:0.1
281   artifacts:
282     when: always
283     expire_in: 2 week
284     reports:
285       junit: junit.xml
286     paths:
287       - ghc.tar.xz
288       - junit.xml
289   tags:
290     - circleci
291
292 # All validation jobs keep the bindists and test results are artifacts,
293 # when we get far enough to generate them.
294 #
295 # This requires updating the maximum artifacts size limit in Gitlab to
296 # something like 200MB.
297
298 circleci-validate-x86_64-linux-deb8:
299   extends: .circleci
300   script: ".gitlab/circle-ci-job.sh validate-x86_64-linux-deb8"
301
302 circleci-validate-i386-linux-deb8:
303   extends: .circleci
304   script: ".gitlab/circle-ci-job.sh validate-i386-linux-deb8"
305
306 # circleci-validate-x86_64-freebsd:
307 #   extends: .circleci
308 #   script: ".gitlab/circle-ci-job.sh validate-x86_64-freebsd"
309
310 circleci-validate-x86_64-darwin:
311   extends: .circleci
312   script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"