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