.gitlab-ci.yml 9.67 KB
Newer Older
1
2
variables:
  GIT_SSL_NO_VERIFY: "1"
3
4
5
6
7
8

before_script:
  - python3 .gitlab/fix-submodules.py
  - git submodule sync --recursive
  - git submodule update --init --recursive
  - git checkout .gitmodules
9

Ben Gamari's avatar
Ben Gamari committed
10
11
12
stages:
  - lint
  - build
13
  - full-build
Ben Gamari's avatar
Ben Gamari committed
14

Ben Gamari's avatar
Ben Gamari committed
15
16
17
18
19
20
21
22
23
24
25
26
############################################################
# Tags
############################################################
#
# * x86_64-linux: Any Docker-capable x86_64 Linux machine
# * aarch64-linux: Any Docker-capable AArch64 Linux machine
# * x86_64-windows: A x86_64 Windows machine
# * lint: Any Docker-capable x86_64 Linux machine; distinct from
#         x86_64-linux to ensure low-latency availability.
#


Ben Gamari's avatar
Ben Gamari committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
############################################################
# Linting
############################################################

ghc-linters:
  stage: lint
  image: ghcci/linters:0.1
  script:
    - |
      if [ -n "$CI_MERGE_REQUEST_ID" ]; then
        base="$(git merge-base $CI_MERGE_REQUEST_BRANCH_NAME HEAD)"
        validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
        submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
        validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
        .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
        .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
      fi
Ben Gamari's avatar
Ben Gamari committed
44
45
  tags:
    - lint
Ben Gamari's avatar
Ben Gamari committed
46

Ben Gamari's avatar
Ben Gamari committed
47
48
49
############################################################
# Validation via Pipelines (hadrian)
############################################################
50

Ben Gamari's avatar
Ben Gamari committed
51
.validate-hadrian:
Ben Gamari's avatar
Ben Gamari committed
52
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
53
  script:
54
    - git clean -xdf && git submodule foreach git clean -xdf
Ben Gamari's avatar
Ben Gamari committed
55
56
57
    - bash .circleci/prepare-system.sh
    - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
    - ./boot
Ben Gamari's avatar
Ben Gamari committed
58
    - ./configure $CONFIGURE_ARGS
Ben Gamari's avatar
Ben Gamari committed
59
60
61
    - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh`
  cache:
    key: hadrian
62
    paths:
Ben Gamari's avatar
Ben Gamari committed
63
      - cabal-cache
64

Ben Gamari's avatar
Ben Gamari committed
65
validate-x86_64-linux-deb8-hadrian:
Ben Gamari's avatar
Ben Gamari committed
66
  extends: .validate-hadrian
67
  stage: build
Ben Gamari's avatar
Ben Gamari committed
68
  image: ghcci/x86_64-linux-deb8:0.1
Ben Gamari's avatar
Ben Gamari committed
69
70
71
  before_script:
    # workaround for docker permissions
    - sudo chown ghc:ghc -R .
72
73
74
75
    - python3 .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules
Ben Gamari's avatar
Ben Gamari committed
76
77
78
79
80
81
82
83
  tags:
    - x86_64-linux

############################################################
# Validation via Pipelines (make)
############################################################

.validate:
84
85
  variables:
    TEST_TYPE: test
Ben Gamari's avatar
Ben Gamari committed
86
  script:
87
    - git clean -xdf && git submodule foreach git clean -xdf
Ben Gamari's avatar
Ben Gamari committed
88
    - ./boot
Ben Gamari's avatar
Ben Gamari committed
89
    - ./configure $CONFIGURE_ARGS
Ben Gamari's avatar
Ben Gamari committed
90
91
    - |
      THREADS=`mk/detect-cpu-count.sh`
92
      make V=0 -j$THREADS
Ben Gamari's avatar
Ben Gamari committed
93
94
95
96
97
    - |
      make binary-dist TAR_COMP_OPTS="-1"
      mv ghc-*.tar.xz ghc.tar.xz
    - |
      THREADS=`mk/detect-cpu-count.sh`
98
      make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml
99
100
101
  artifacts:
    reports:
      junit: junit.xml
102
    expire_in: 2 week
103
104
105
106
    paths:
      - ghc.tar.xz
      - junit.xml

Ben Gamari's avatar
Ben Gamari committed
107
validate-x86_64-darwin:
Ben Gamari's avatar
Ben Gamari committed
108
  extends: .validate
109
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
110
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
111
112
113
  tags:
    - x86_64-darwin
  variables:
114
    GHC_VERSION: 8.6.3
Ben Gamari's avatar
Ben Gamari committed
115
116
117
    MACOSX_DEPLOYMENT_TARGET: "10.7"
    # Only Sierra and onwards supports clock_gettime. See #12858
    ac_cv_func_clock_gettime: "no"
118
    LANG: "en_US.UTF-8"
Ben Gamari's avatar
Ben Gamari committed
119
  before_script:
120
121
122
123
124
    - python .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules

Ben Gamari's avatar
Ben Gamari committed
125
126
127
128
    - bash .gitlab/darwin-init.sh
    - PATH="`pwd`/toolchain/bin:$PATH"
      # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
    - echo "BUILD_SPHINX_PDF=NO" >> mk/build.mk
Ben Gamari's avatar
Ben Gamari committed
129
    - echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
Ben Gamari's avatar
Ben Gamari committed
130
131
  after_script:
    - cp -Rf $HOME/.cabal cabal-cache
132
133
  artifacts:
    when: always
134
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
135
136
137
138
139
140
  cache:
    key: darwin
    paths:
      - cabal-cache
      - toolchain

Ben Gamari's avatar
Ben Gamari committed
141
.validate-linux:
Ben Gamari's avatar
Ben Gamari committed
142
143
144
145
  extends: .validate
  tags:
    - x86_64-linux
  before_script:
146
147
148
149
150
    - python3 .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules

Ben Gamari's avatar
Ben Gamari committed
151
152
153
154
155
156
    - bash .circleci/prepare-system.sh
    # workaround for docker permissions
    - sudo chown ghc:ghc -R .
  after_script:
    - cp -Rf $HOME/.cabal cabal-cache
  cache:
Ben Gamari's avatar
Ben Gamari committed
157
    key: linux
Ben Gamari's avatar
Ben Gamari committed
158
159
160
161
    paths:
      - cabal-cache
      - toolchain

Ben Gamari's avatar
Ben Gamari committed
162
163
validate-aarch64-linux-deb9:
  extends: .validate-linux
164
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
165
166
167
168
  image: ghcci/aarch64-linux-deb9:0.1
  allow_failure: true
  artifacts:
    when: always
169
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
170
171
172
173
174
  cache:
    key: linux-aarch64-deb9
  tags:
    - aarch64-linux

175
176
nightly-aarch64-linux-deb9:
  extends: validate-aarch64-linux-deb9
177
  stage: full-build
178
179
180
181
182
183
184
185
  artifacts:
    expire_in: 2 year
  variables:
    TEST_TYPE: slowtest
  only:
    variables:
      - $NIGHTLY

186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
validate-i386-linux-deb9:
  extends: .validate-linux
  stage: full-build
  image: ghcci/i386-linux-deb9:0.1
  allow_failure: true
  artifacts:
    when: always
    expire_in: 2 week
  cache:
    key: linux-i386-deb9

nightly-i386-linux-deb9:
  extends: .validate-linux
  stage: full-build
  image: ghcci/i386-linux-deb9:0.1
  allow_failure: true
  variables:
    TEST_TYPE: slowtest
  artifacts:
    when: always
    expire_in: 2 week
207
208
209
  only:
    variables:
      - $NIGHTLY
210
211
212
  cache:
    key: linux-i386-deb9

Ben Gamari's avatar
Ben Gamari committed
213
214
validate-x86_64-linux-deb9:
  extends: .validate-linux
215
  stage: build
Ben Gamari's avatar
Ben Gamari committed
216
217
218
  image: ghcci/x86_64-linux-deb9:0.2
  artifacts:
    when: always
219
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
220
221
222
  cache:
    key: linux-x86_64-deb9

223
224
nightly-x86_64-linux-deb9:
  extends: validate-x86_64-linux-deb9
225
  stage: build
226
227
228
229
230
231
232
233
  artifacts:
    expire_in: 2 year
  variables:
    TEST_TYPE: slowtest
  only:
    variables:
      - $NIGHTLY

Ben Gamari's avatar
Ben Gamari committed
234
235
validate-x86_64-linux-deb9-llvm:
  extends: .validate-linux
236
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
237
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
238
239
240
  image: ghcci/x86_64-linux-deb9:0.2
  variables:
    BUILD_FLAVOUR: perf-llvm
Ben Gamari's avatar
Ben Gamari committed
241
242
243
244
245
  cache:
    key: linux-x86_64-deb9

validate-x86_64-linux-deb8:
  extends: .validate-linux
246
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
247
248
249
  image: ghcci/x86_64-linux-deb8:0.1
  cache:
    key: linux-x86_64-deb8
250
251
  artifacts:
    when: always
252
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
253
254
255

validate-x86_64-linux-fedora27:
  extends: .validate-linux
256
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
257
258
259
  image: ghcci/x86_64-linux-fedora27:0.1
  cache:
    key: linux-x86_64-fedora27
260
261
  artifacts:
    when: always
262
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
263
264
265

validate-x86_64-linux-deb9-integer-simple:
  extends: .validate-linux
266
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
267
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
268
269
  variables:
    INTEGER_LIBRARY: integer-simple
Ben Gamari's avatar
Ben Gamari committed
270
  image: ghcci/x86_64-linux-deb9:0.2
Ben Gamari's avatar
Ben Gamari committed
271
272
273
  cache:
    key: linux-x86_64-deb9

274
275
nightly-x86_64-linux-deb9-integer-simple:
  extends: validate-x86_64-linux-deb9-integer-simple
276
  stage: full-build
277
278
279
280
281
282
283
284
  artifacts:
    expire_in: 2 year
  variables:
    TEST_TYPE: slowtest
  only:
    variables:
      - $NIGHTLY

Ben Gamari's avatar
Ben Gamari committed
285
286
validate-x86_64-linux-deb9-unreg:
  extends: .validate-linux
287
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
288
289
  variables:
    CONFIGURE_ARGS: --enable-unregisterised
Ben Gamari's avatar
Ben Gamari committed
290
  image: ghcci/x86_64-linux-deb9:0.2
Ben Gamari's avatar
Ben Gamari committed
291
292
293
  cache:
    key: linux-x86_64-deb9

Ben Gamari's avatar
Ben Gamari committed
294
############################################################
295
# Validation via Pipelines (Windows)
Ben Gamari's avatar
Ben Gamari committed
296
297
############################################################

Ben Gamari's avatar
Ben Gamari committed
298
299
.validate-windows:
  before_script:
300
    - git clean -xdf
301
    - git submodule foreach git clean -xdf
Ben Gamari's avatar
Ben Gamari committed
302
303
304
305
306
307
308
309
310
311
312
313
    - PATH=C:\msys64\usr\bin;%PATH%
    - python .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules
    - bash .gitlab/win32-init.sh
  cache:
    paths:
      - cabal-cache
      - ghc-8.6.2
      - ghc-tarballs

314
validate-x86_64-windows-hadrian:
Ben Gamari's avatar
Ben Gamari committed
315
  extends: .validate-windows
316
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
317
318
  variables:
    GHC_VERSION: "8.6.2"
Ben Gamari's avatar
Ben Gamari committed
319
    LANG: "en_US.UTF-8"
320
321
  # due to #16073
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
322
323
324
325
326
327
328
  script:
    - |
      set MSYSTEM=MINGW64
      python boot
      bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
      mkdir -p _build
      cp -R inplace/mingw _build/mingw
329
330
    # FIXME: --no-lint due to #15950
    - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint"
Ben Gamari's avatar
Ben Gamari committed
331
    - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
332
    - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
Ben Gamari's avatar
Ben Gamari committed
333
334
    - cp -Rf $APPDATA/cabal cabal-cache
  cache:
Ben Gamari's avatar
Ben Gamari committed
335
    key: x86_64-windows
Ben Gamari's avatar
Ben Gamari committed
336
337
338
  tags:
    - x86_64-windows

339
validate-x86_64-windows:
Ben Gamari's avatar
Ben Gamari committed
340
  extends: .validate-windows
341
  stage: full-build
342
343
  variables:
    GHC_VERSION: "8.6.2"
Ben Gamari's avatar
Ben Gamari committed
344
    LANG: "en_US.UTF-8"
345
346
347
348
349
350
  script:
    - |
      set MSYSTEM=MINGW64
      python boot
      bash -c './configure --with-ghc=`pwd`/toolchain/bin/ghc --enable-tarballs-autodownload HappyCmd=`pwd`/toolchain/bin/happy AlexCmd=`pwd`/toolchain/bin/alex'
    - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
351
    - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
352
353
    - cp -Rf $APPDATA/cabal cabal-cache
  cache:
Ben Gamari's avatar
Ben Gamari committed
354
    key: x86_64-windows
355
356
  tags:
    - x86_64-windows
Ben Gamari's avatar
Ben Gamari committed
357
358
359
360
361
362

############################################################
# Validation via CircleCI
############################################################

.circleci:
Ben Gamari's avatar
Ben Gamari committed
363
  stage: build
364
  image: ghcci/x86_64-linux-deb8:0.1
365
366
  artifacts:
    when: always
367
    expire_in: 2 week
368
369
370
371
372
    reports:
      junit: junit.xml
    paths:
      - ghc.tar.xz
      - junit.xml
373
374
  tags:
    - circleci
375

Ben Gamari's avatar
Ben Gamari committed
376
377
378
379
380
381
382
383
# All validation jobs keep the bindists and test results are artifacts,
# when we get far enough to generate them.
#
# This requires updating the maximum artifacts size limit in Gitlab to
# something like 200MB.

circleci-validate-x86_64-darwin:
  extends: .circleci
384
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
385
  script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"