.gitlab-ci.yml 8.87 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 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

############################################################
# 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
33 34 35
############################################################
# Validation via Pipelines (hadrian)
############################################################
36

Ben Gamari's avatar
Ben Gamari committed
37
.validate-hadrian:
Ben Gamari's avatar
Ben Gamari committed
38
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
39 40 41 42
  script:
    - 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
43
    - ./configure $CONFIGURE_ARGS
Ben Gamari's avatar
Ben Gamari committed
44 45 46
    - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh`
  cache:
    key: hadrian
47
    paths:
Ben Gamari's avatar
Ben Gamari committed
48
      - cabal-cache
49

Ben Gamari's avatar
Ben Gamari committed
50
validate-x86_64-linux-deb8-hadrian:
Ben Gamari's avatar
Ben Gamari committed
51
  extends: .validate-hadrian
52
  stage: build
Ben Gamari's avatar
Ben Gamari committed
53
  image: ghcci/x86_64-linux-deb8:0.1
Ben Gamari's avatar
Ben Gamari committed
54 55 56
  before_script:
    # workaround for docker permissions
    - sudo chown ghc:ghc -R .
57 58 59 60
    - python3 .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules
Ben Gamari's avatar
Ben Gamari committed
61 62 63 64 65 66 67 68
  tags:
    - x86_64-linux

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

.validate:
69 70
  variables:
    TEST_TYPE: test
Ben Gamari's avatar
Ben Gamari committed
71 72 73
  script:
    - make clean || true
    - ./boot
Ben Gamari's avatar
Ben Gamari committed
74
    - ./configure $CONFIGURE_ARGS
Ben Gamari's avatar
Ben Gamari committed
75 76
    - |
      THREADS=`mk/detect-cpu-count.sh`
77
      make V=0 -j$THREADS
Ben Gamari's avatar
Ben Gamari committed
78 79 80 81 82
    - |
      make binary-dist TAR_COMP_OPTS="-1"
      mv ghc-*.tar.xz ghc.tar.xz
    - |
      THREADS=`mk/detect-cpu-count.sh`
83
      make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml
84 85 86
  artifacts:
    reports:
      junit: junit.xml
87
    expire_in: 2 week
88 89 90 91
    paths:
      - ghc.tar.xz
      - junit.xml

Ben Gamari's avatar
Ben Gamari committed
92
validate-x86_64-darwin:
Ben Gamari's avatar
Ben Gamari committed
93
  extends: .validate
94
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
95
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
96 97 98
  tags:
    - x86_64-darwin
  variables:
99
    GHC_VERSION: 8.6.3
Ben Gamari's avatar
Ben Gamari committed
100 101 102
    MACOSX_DEPLOYMENT_TARGET: "10.7"
    # Only Sierra and onwards supports clock_gettime. See #12858
    ac_cv_func_clock_gettime: "no"
103
    LANG: "en_US.UTF-8"
Ben Gamari's avatar
Ben Gamari committed
104
  before_script:
105 106 107 108 109
    - python .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules

Ben Gamari's avatar
Ben Gamari committed
110 111 112 113
    - 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
114
    - echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
Ben Gamari's avatar
Ben Gamari committed
115 116
  after_script:
    - cp -Rf $HOME/.cabal cabal-cache
117 118
  artifacts:
    when: always
119
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
120 121 122 123 124 125
  cache:
    key: darwin
    paths:
      - cabal-cache
      - toolchain

Ben Gamari's avatar
Ben Gamari committed
126
.validate-linux:
Ben Gamari's avatar
Ben Gamari committed
127 128 129 130
  extends: .validate
  tags:
    - x86_64-linux
  before_script:
131 132 133 134 135
    - python3 .gitlab/fix-submodules.py
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - git checkout .gitmodules

Ben Gamari's avatar
Ben Gamari committed
136 137 138 139 140 141
    - 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
142
    key: linux
Ben Gamari's avatar
Ben Gamari committed
143 144 145 146
    paths:
      - cabal-cache
      - toolchain

Ben Gamari's avatar
Ben Gamari committed
147 148
validate-aarch64-linux-deb9:
  extends: .validate-linux
149
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
150 151 152 153
  image: ghcci/aarch64-linux-deb9:0.1
  allow_failure: true
  artifacts:
    when: always
154
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
155 156 157 158 159
  cache:
    key: linux-aarch64-deb9
  tags:
    - aarch64-linux

160 161
nightly-aarch64-linux-deb9:
  extends: validate-aarch64-linux-deb9
162
  stage: full-build
163 164 165 166 167 168 169 170
  artifacts:
    expire_in: 2 year
  variables:
    TEST_TYPE: slowtest
  only:
    variables:
      - $NIGHTLY

Ben Gamari's avatar
Ben Gamari committed
171 172
validate-x86_64-linux-deb9:
  extends: .validate-linux
173
  stage: build
Ben Gamari's avatar
Ben Gamari committed
174 175 176
  image: ghcci/x86_64-linux-deb9:0.2
  artifacts:
    when: always
177
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
178 179 180
  cache:
    key: linux-x86_64-deb9

181 182
nightly-x86_64-linux-deb9:
  extends: validate-x86_64-linux-deb9
183
  stage: build
184 185 186 187 188 189 190 191
  artifacts:
    expire_in: 2 year
  variables:
    TEST_TYPE: slowtest
  only:
    variables:
      - $NIGHTLY

Ben Gamari's avatar
Ben Gamari committed
192 193
validate-x86_64-linux-deb9-llvm:
  extends: .validate-linux
194
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
195
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
196 197 198
  image: ghcci/x86_64-linux-deb9:0.2
  variables:
    BUILD_FLAVOUR: perf-llvm
Ben Gamari's avatar
Ben Gamari committed
199 200 201 202 203
  cache:
    key: linux-x86_64-deb9

validate-x86_64-linux-deb8:
  extends: .validate-linux
204
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
205 206 207
  image: ghcci/x86_64-linux-deb8:0.1
  cache:
    key: linux-x86_64-deb8
208 209
  artifacts:
    when: always
210
    expire_in: 2 week
Ben Gamari's avatar
Ben Gamari committed
211 212 213

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

validate-x86_64-linux-deb9-integer-simple:
  extends: .validate-linux
224
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
225
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
226 227
  variables:
    INTEGER_LIBRARY: integer-simple
Ben Gamari's avatar
Ben Gamari committed
228
  image: ghcci/x86_64-linux-deb9:0.2
Ben Gamari's avatar
Ben Gamari committed
229 230 231
  cache:
    key: linux-x86_64-deb9

232 233
nightly-x86_64-linux-deb9-integer-simple:
  extends: validate-x86_64-linux-deb9-integer-simple
234
  stage: full-build
235 236 237 238 239 240 241 242
  artifacts:
    expire_in: 2 year
  variables:
    TEST_TYPE: slowtest
  only:
    variables:
      - $NIGHTLY

Ben Gamari's avatar
Ben Gamari committed
243 244
validate-x86_64-linux-deb9-unreg:
  extends: .validate-linux
245
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
246 247
  variables:
    CONFIGURE_ARGS: --enable-unregisterised
Ben Gamari's avatar
Ben Gamari committed
248
  image: ghcci/x86_64-linux-deb9:0.2
Ben Gamari's avatar
Ben Gamari committed
249 250 251
  cache:
    key: linux-x86_64-deb9

Ben Gamari's avatar
Ben Gamari committed
252
############################################################
253
# Validation via Pipelines (Windows)
Ben Gamari's avatar
Ben Gamari committed
254 255
############################################################

256
validate-x86_64-windows-hadrian:
257
  stage: full-build
Ben Gamari's avatar
Ben Gamari committed
258 259
  variables:
    GHC_VERSION: "8.6.2"
260 261
  # due to #16073
  allow_failure: true
Ben Gamari's avatar
Ben Gamari committed
262
  script:
263
    - PATH=C:\msys64\usr\bin;%PATH%
264
    - bash .gitlab/win32-init.sh
Ben Gamari's avatar
Ben Gamari committed
265 266 267 268 269 270
    - |
      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
271 272
    # 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
273 274 275 276 277
    - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist"
    - mv ghc-*.tar.xz ghc.tar.xz
    - bash -c 'make V=0 -j`mk/detect-cpu-count.sh` HADDOCK_DOCS=NO test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
    - cp -Rf $APPDATA/cabal cabal-cache
  cache:
278
    key: windows-hadrian
Ben Gamari's avatar
Ben Gamari committed
279 280 281 282 283 284 285
    paths:
      - cabal-cache
      - ghc-8.6.2
      - ghc-tarballs
  tags:
    - x86_64-windows

286
validate-x86_64-windows:
287
  stage: full-build
288 289 290
  variables:
    GHC_VERSION: "8.6.2"
  script:
291 292
    - PATH=C:\msys64\usr\bin;%PATH%
    - bash .gitlab/win32-init.sh
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
    - |
      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`"
    - mv ghc-*.tar.xz ghc.tar.xz
    - bash -c 'make V=0 -j`mk/detect-cpu-count.sh` HADDOCK_DOCS=NO test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
    - cp -Rf $APPDATA/cabal cabal-cache
  cache:
    key: windows
    paths:
      - cabal-cache
      - ghc-8.6.2
      - ghc-tarballs
  tags:
    - x86_64-windows
Ben Gamari's avatar
Ben Gamari committed
309 310 311 312 313 314

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

.circleci:
Ben Gamari's avatar
Ben Gamari committed
315
  stage: build
316
  image: ghcci/x86_64-linux-deb8:0.1
317 318
  artifacts:
    when: always
319
    expire_in: 2 week
320 321 322 323 324
    reports:
      junit: junit.xml
    paths:
      - ghc.tar.xz
      - junit.xml
325 326
  tags:
    - circleci
327

Ben Gamari's avatar
Ben Gamari committed
328 329 330 331 332 333
# 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.

334 335 336 337 338 339 340 341 342 343 344 345
circleci-validate-x86_64-linux-deb8:
  extends: .circleci
  script: ".gitlab/circle-ci-job.sh validate-x86_64-linux-deb8"

circleci-validate-i386-linux-deb8:
  extends: .circleci
  script: ".gitlab/circle-ci-job.sh validate-i386-linux-deb8"

# circleci-validate-x86_64-freebsd:
#   extends: .circleci
#   script: ".gitlab/circle-ci-job.sh validate-x86_64-freebsd"

Ben Gamari's avatar
Ben Gamari committed
346 347 348
circleci-validate-x86_64-darwin:
  extends: .circleci
  script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin"