5 - python3 .gitlab/fix-submodules.py
6 - git submodule sync --recursive
7 - git submodule update --init --recursive
8 - git checkout .gitmodules
9 - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
15 - cleanup # See Note [Cleanup on Windows]
17 ############################################################
19 ############################################################
21 # * x86_64-linux: Any Docker-capable x86_64 Linux machine
22 # * aarch64-linux: Any Docker-capable AArch64 Linux machine
23 # * x86_64-windows: A x86_64 Windows machine
24 # * lint: Any Docker-capable x86_64 Linux machine; distinct from
25 # x86_64-linux to ensure low-latency availability.
29 ############################################################
31 ############################################################
35 image: ghcci/linters:0.1
38 if [ -n "$CI_MERGE_REQUEST_ID" ]; then
39 base="$(git merge-base $CI_MERGE_REQUEST_BRANCH_NAME HEAD)"
40 validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
41 submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
42 validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
43 .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
44 .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA
50 ############################################################
51 # Validation via Pipelines (hadrian)
52 ############################################################
57 - git clean -xdf && git submodule foreach git clean -xdf
58 - bash .circleci/prepare-system.sh
59 - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
61 - ./configure $CONFIGURE_ARGS
62 - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh`
68 validate-x86_64-linux-deb8-hadrian:
69 extends: .validate-hadrian
71 image: ghcci/x86_64-linux-deb8:0.1
73 # workaround for docker permissions
74 - sudo chown ghc:ghc -R .
75 - python3 .gitlab/fix-submodules.py
76 - git submodule sync --recursive
77 - git submodule update --init --recursive
78 - git checkout .gitmodules
79 - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
83 ############################################################
84 # Validation via Pipelines (make)
85 ############################################################
91 - git clean -xdf && git submodule foreach git clean -xdf
94 - ./configure $CONFIGURE_ARGS
96 THREADS=`mk/detect-cpu-count.sh`
99 make binary-dist TAR_COMP_OPTS="-1"
100 mv ghc-*.tar.xz ghc.tar.xz
102 # Prepare to push git notes.
103 METRICS_FILE=$(mktemp)
104 git config user.email "ben+ghc-ci@smart-cactus.org"
105 git config user.name "GHC GitLab CI"
107 THREADS=`mk/detect-cpu-count.sh`
108 make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml METRICS_FILE=$METRICS_FILE
111 METRICS_FILE=$METRICS_FILE .gitlab/push-test-metrics.sh
121 validate-x86_64-darwin:
128 MACOSX_DEPLOYMENT_TARGET: "10.7"
129 # Only Sierra and onwards supports clock_gettime. See #12858
130 ac_cv_func_clock_gettime: "no"
132 CONFIGURE_ARGS: --with-intree-gmp
133 TEST_ENV: "x86_64-darwin"
135 - git clean -xdf && git submodule foreach git clean -xdf
136 - python3 .gitlab/fix-submodules.py
137 - git submodule sync --recursive
138 - git submodule update --init --recursive
139 - git checkout .gitmodules
140 - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
142 - bash .gitlab/darwin-init.sh
143 - PATH="`pwd`/toolchain/bin:$PATH"
145 - cp -Rf $HOME/.cabal cabal-cache
160 - git clean -xdf && git submodule foreach git clean -xdf
161 - python3 .gitlab/fix-submodules.py
162 - git submodule sync --recursive
163 - git submodule update --init --recursive
164 - git checkout .gitmodules
165 - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
167 - bash .circleci/prepare-system.sh
168 # workaround for docker permissions
169 - sudo chown ghc:ghc -R .
171 - cp -Rf $HOME/.cabal cabal-cache
178 validate-aarch64-linux-deb9:
179 extends: .validate-linux
181 image: ghcci/aarch64-linux-deb9:0.1
184 TEST_ENV: "aarch64-linux-deb9"
189 key: linux-aarch64-deb9
193 nightly-aarch64-linux-deb9:
194 extends: validate-aarch64-linux-deb9
204 validate-i386-linux-deb9:
205 extends: .validate-linux
207 image: ghcci/i386-linux-deb9:0.1
210 TEST_ENV: "i386-linux-deb9"
217 nightly-i386-linux-deb9:
218 extends: .validate-linux
220 image: ghcci/i386-linux-deb9:0.1
224 TEST_ENV: "i386-linux-deb9"
234 validate-x86_64-linux-deb9:
235 extends: .validate-linux
237 image: ghcci/x86_64-linux-deb9:0.2
239 TEST_ENV: "x86_64-linux-deb9"
244 key: linux-x86_64-deb9
246 nightly-x86_64-linux-deb9:
247 extends: validate-x86_64-linux-deb9
257 validate-x86_64-linux-deb9-llvm:
258 extends: .validate-linux
261 image: ghcci/x86_64-linux-deb9:0.2
263 BUILD_FLAVOUR: perf-llvm
264 TEST_ENV: "x86_64-linux-deb9-llvm"
266 key: linux-x86_64-deb9
268 validate-x86_64-linux-deb8:
269 extends: .validate-linux
271 image: ghcci/x86_64-linux-deb8:0.1
273 TEST_ENV: "x86_64-linux-deb8"
275 key: linux-x86_64-deb8
280 validate-x86_64-linux-fedora27:
281 extends: .validate-linux
283 image: ghcci/x86_64-linux-fedora27:0.1
285 TEST_ENV: "x86_64-linux-fedora27"
287 key: linux-x86_64-fedora27
292 validate-x86_64-linux-deb9-integer-simple:
293 extends: .validate-linux
296 INTEGER_LIBRARY: integer-simple
297 TEST_ENV: "x86_64-linux-deb9-integer-simple"
298 image: ghcci/x86_64-linux-deb9:0.2
300 key: linux-x86_64-deb9
302 nightly-x86_64-linux-deb9-integer-simple:
303 extends: validate-x86_64-linux-deb9-integer-simple
313 validate-x86_64-linux-deb9-unreg:
314 extends: .validate-linux
317 CONFIGURE_ARGS: --enable-unregisterised
318 TEST_ENV: "x86_64-linux-deb9-unreg"
319 image: ghcci/x86_64-linux-deb9:0.2
321 key: linux-x86_64-deb9
323 ############################################################
324 # Validation via Pipelines (Windows)
325 ############################################################
330 - git submodule foreach git clean -xdf
332 # Use a local temporary directory to ensure that concurrent builds don't
333 # interfere with one another
339 - set PATH=C:\msys64\usr\bin;%PATH%
340 - python .gitlab/fix-submodules.py
341 - git submodule sync --recursive
342 - git submodule update --init --recursive
343 - git checkout .gitmodules
344 - "git fetch origin refs/notes/perf:refs/notes/ci/perf || true"
345 - bash .gitlab/win32-init.sh
348 - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache
349 - bash -c 'make clean || true'
357 validate-x86_64-windows-hadrian:
358 extends: .validate-windows
367 bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
369 cp -R inplace/mingw _build/mingw
370 - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick"
371 # FIXME: Bindist disabled due to #16073
372 #- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
373 # FIXME: Testsuite disabled due to #16156.
374 #- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
380 validate-x86_64-windows:
381 extends: .validate-windows
392 bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
393 - bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
394 - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
396 bash -c "make binary-dist TAR_COMP_OPTS=-1"
397 mv ghc-*.tar.xz ghc.tar.xz
398 - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
411 # Note [Cleaning up after shell executor]
412 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
414 # As noted in [1], gitlab-runner's shell executor doesn't clean up its working
415 # directory after builds. Unfortunately, we are forced to use the shell executor
416 # on Windows. To avoid running out of disk space we add a stage at the end of
417 # the build to remove the \GitLabRunner\builds directory. Since we only run a
418 # single build at a time on Windows this should be safe.
420 # [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856
422 # See Note [Cleanup after shell executor]
430 - echo "Time to clean up"
434 - set "BUILD_DIR=%CI_PROJECT_DIR%"
435 - set "BUILD_DIR=%BUILD_DIR:/=\%"
436 - echo "Cleaning %BUILD_DIR%"
438 # This is way more complicated than it should be:
439 # See https://stackoverflow.com/questions/1965787
440 - del %BUILD_DIR%\* /F /Q
441 - for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p"
444 # See Note [Cleanup after shell executor]
451 - echo "Time to clean up"
455 - BUILD_DIR=$CI_PROJECT_DIR
456 - echo "Cleaning $BUILD_DIR"
458 - rm -Rf $BUILD_DIR/*