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