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