.gitlab-ci.yml 10 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
# Runner Tags
Ben Gamari's avatar
Ben Gamari committed
17
18
19
20
21
22
23
24
25
26
############################################################
#
# * 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
  before_script:
87
    - git clean -xdf && git submodule foreach git clean -xdf
Ben Gamari's avatar
Ben Gamari committed
88
  script:
Ben Gamari's avatar
Ben Gamari committed
89
    - ./boot
Ben Gamari's avatar
Ben Gamari committed
90
    - ./configure $CONFIGURE_ARGS
Ben Gamari's avatar
Ben Gamari committed
91
92
    - |
      THREADS=`mk/detect-cpu-count.sh`
93
      make V=0 -j$THREADS
Ben Gamari's avatar
Ben Gamari committed
94
95
96
97
98
    - |
      make binary-dist TAR_COMP_OPTS="-1"
      mv ghc-*.tar.xz ghc.tar.xz
    - |
      THREADS=`mk/detect-cpu-count.sh`
99
      make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml
100
101
102
  artifacts:
    reports:
      junit: junit.xml
103
    expire_in: 2 week
104
105
106
107
    paths:
      - ghc.tar.xz
      - junit.xml

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

Ben Gamari's avatar
Ben Gamari committed
127
128
    - bash .gitlab/darwin-init.sh
    - PATH="`pwd`/toolchain/bin:$PATH"
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:
Ben Gamari's avatar
Ben Gamari committed
146
    - git clean -xdf && git submodule foreach git clean -xdf
147
148
149
150
151
    - python3 .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules

Ben Gamari's avatar
Ben Gamari committed
152
153
154
155
156
157
    - 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
158
    key: linux
Ben Gamari's avatar
Ben Gamari committed
159
160
161
162
    paths:
      - cabal-cache
      - toolchain

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

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

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
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
208
209
210
  only:
    variables:
      - $NIGHTLY
211
212
213
  cache:
    key: linux-i386-deb9

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

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

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

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

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

validate-x86_64-linux-deb9-integer-simple:
  extends: .validate-linux
267
  stage: full-build
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
302
303
304
305
306
307
308
309
310

    # Use a local temporary directory to ensure that concurrent builds don't
    # interfere with one another
    - |
      mkdir tmp
      set TMP=%cd%\tmp
      set TEMP=%cd%\tmp

    - set PATH=C:\msys64\usr\bin;%PATH%
Ben Gamari's avatar
Ben Gamari committed
311
312
313
314
315
    - python .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules
    - bash .gitlab/win32-init.sh
316
317
  after_script:
    - rd /s /q tmp
318
    - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache
319
    - bash -c 'make clean || true'
Ben Gamari's avatar
Ben Gamari committed
320
321
322
323
324
325
  cache:
    paths:
      - cabal-cache
      - ghc-8.6.2
      - ghc-tarballs

326
validate-x86_64-windows-hadrian:
Ben Gamari's avatar
Ben Gamari committed
327
  extends: .validate-windows
328
  stage: full-build
329
330
  # due to #16073
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
331
332
  variables:
    GHC_VERSION: "8.6.2"
Ben Gamari's avatar
Ben Gamari committed
333
    LANG: "en_US.UTF-8"
Ben Gamari's avatar
Ben Gamari committed
334
335
336
337
  script:
    - |
      set MSYSTEM=MINGW64
      python boot
338
      bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
Ben Gamari's avatar
Ben Gamari committed
339
340
      mkdir -p _build
      cp -R inplace/mingw _build/mingw
341
342
    # 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
343
    - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
344
    - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
Ben Gamari's avatar
Ben Gamari committed
345
  cache:
Ben Gamari's avatar
Ben Gamari committed
346
    key: x86_64-windows
Ben Gamari's avatar
Ben Gamari committed
347
348
349
  tags:
    - x86_64-windows

350
validate-x86_64-windows:
Ben Gamari's avatar
Ben Gamari committed
351
  extends: .validate-windows
352
  stage: full-build
353
354
  # due to #16084
  allow_failure: true
355
356
  variables:
    GHC_VERSION: "8.6.2"
Ben Gamari's avatar
Ben Gamari committed
357
    LANG: "en_US.UTF-8"
358
359
360
361
  script:
    - |
      set MSYSTEM=MINGW64
      python boot
362
      bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
363
    - bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
364
    - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
365
    - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
366
  cache:
Ben Gamari's avatar
Ben Gamari committed
367
    key: x86_64-windows
368
369
  tags:
    - x86_64-windows
Ben Gamari's avatar
Ben Gamari committed
370
371
372
373
374
375

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

.circleci:
Ben Gamari's avatar
Ben Gamari committed
376
  stage: build
377
  image: ghcci/x86_64-linux-deb8:0.1
378
379
  artifacts:
    when: always
380
    expire_in: 2 week
381
382
383
384
385
    reports:
      junit: junit.xml
    paths:
      - ghc.tar.xz
      - junit.xml
386
387
  tags:
    - circleci
388

Ben Gamari's avatar
Ben Gamari committed
389
390
391
392
393
394
# 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.

395
.circleci-validate-x86_64-darwin:
Ben Gamari's avatar
Ben Gamari committed
396
  extends: .circleci
397
  stage: full-build
398
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
399
  script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"