TH: make `Lift` and `TExp` levity-polymorphic
[ghc.git] / .gitlab-ci.yml
index 84f0816..9a1ca2e 100644 (file)
@@ -4,6 +4,10 @@ variables:
   # Commit of ghc/ci-images repository from which to pull Docker images
   DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c
 
+  # Sequential version number capturing the versions of all tools fetched by
+  # .gitlab/win32-init.sh.
+  WINDOWS_TOOLCHAIN_VERSION: 1
+
 before_script:
   - python3 .gitlab/fix-submodules.py
   - git submodule sync --recursive
@@ -18,6 +22,7 @@ stages:
   - cleanup    # See Note [Cleanup on Windows]
   - packaging  # Source distribution, etc.
   - hackage    # head.hackage testing
+  - deploy     # push documentation
 
 .only-default: &only-default
   only:
@@ -25,6 +30,7 @@ stages:
     - /ghc-[0-9]+\.[0-9]+/
     - merge_requests
     - tags
+    - web
 
 ############################################################
 # Runner Tags
@@ -43,21 +49,18 @@ stages:
 ############################################################
 
 ghc-linters:
+  allow_failure: true
   stage: lint
   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
   script:
-    - git fetch origin
-    - git checkout "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
-    - git reset --hard "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
-    - echo "$CI_MERGE_REQUEST_ID"
-    - echo "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
-    - echo "$CI_COMMIT_SHA"
-    - base="$(git merge-base $CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_COMMIT_SHA)"
-    - echo $base
+    - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+    - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
+    - "echo Merge base $base"
     #    - validate-commit-msg .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
+    - .gitlab/linters/check-version-number.sh
   dependencies: []
   tags:
     - lint
@@ -83,7 +86,14 @@ lint-submods:
     refs:
       - master
       - /ghc-[0-9]+\.[0-9]+/
-      - wip/marge_bot_batch_merge_job
+
+lint-submods-marge:
+  extends: .lint-submods
+  only:
+    refs:
+      - merge_requests
+    variables:
+      - $CI_MERGE_REQUEST_LABELS =~ /.*wip/marge_bot_batch_merge_job.*/
 
 lint-submods-mr:
   extends: .lint-submods
@@ -92,6 +102,32 @@ lint-submods-mr:
     refs:
       - merge_requests
 
+.lint-changelogs:
+  stage: lint
+  image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
+  dependencies: []
+  tags:
+    - lint
+  script:
+    - |
+      grep TBA libraries/*/changelog.md && (
+          echo "Error: Found \"TBA\"s in changelogs."
+          exit 1
+      )
+
+lint-changelogs:
+  extends: .lint-changelogs
+  allow_failure: true
+  only:
+    refs:
+      - /ghc-[0-9]+\.[0-9]+/
+
+lint-release-changelogs:
+  extends: .lint-changelogs
+  only:
+    - tags
+
+
 ############################################################
 # Validation via Pipelines (hadrian)
 ############################################################
@@ -152,8 +188,8 @@ hadrian-ghc-in-ghci:
     - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
     - ./boot
     - ./configure $CONFIGURE_ARGS
-    # Load ghc-in-ghci then immediately exit
-    - echo ":q" | hadrian/ghci.sh
+    # Load ghc-in-ghci then immediately exit and check the modules loaded
+    - echo ":q" | hadrian/ghci.sh | tail -n2 | grep "Ok,"
   cache:
     key: hadrian-ghci
     paths:
@@ -247,6 +283,11 @@ validate-x86_64-darwin:
     - git submodule update --init --recursive
     - git checkout .gitmodules
     - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
+      # Build hyperlinked sources for documentation when building releases
+    - |
+      if [[ -n "$CI_COMMIT_TAG" ]]; then
+        echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
+      fi
 
     - bash .circleci/prepare-system.sh
     # workaround for docker permissions
@@ -492,12 +533,12 @@ validate-x86_64-linux-fedora27:
     paths:
       - ghc.tar.xz
 
-validate-x86_64-windows-hadrian:
+.validate-x86_64-windows-hadrian:
   extends: .build-windows-hadrian
   variables:
     MSYSTEM: MINGW64
   cache:
-    key: x86_64-windows-hadrian
+    key: "x86_64-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
 
 nightly-i386-windows-hadrian:
   extends: .build-windows-hadrian
@@ -507,7 +548,7 @@ nightly-i386-windows-hadrian:
     variables:
       - $NIGHTLY
   cache:
-    key: i386-windows-hadrian
+    key: "i386-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
 
 .build-windows-make:
   extends: .build-windows
@@ -515,13 +556,14 @@ nightly-i386-windows-hadrian:
   # due to #16084
   allow_failure: true
   variables:
+    BUILD_FLAVOUR: "quick"
     GHC_VERSION: "8.6.2"
     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-mingw32.tar.xz"
   script:
     - |
       python boot
-      bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
-    - bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
+      bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex $CONFIGURE_ARGS'
+    - bash -c "echo include mk/flavours/${BUILD_FLAVOUR}.mk > mk/build.mk"
     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make binary-dist TAR_COMP_OPTS=-1"
     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
@@ -540,8 +582,19 @@ validate-x86_64-windows:
   extends: .build-windows-make
   variables:
     MSYSTEM: MINGW64
+    CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
   cache:
-    key: x86_64-windows
+    key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
+
+# Normal Windows validate builds are profiled; that won't do for releases.
+release-x86_64-windows:
+  extends: validate-x86_64-windows
+  variables:
+    MSYSTEM: MINGW64
+    BUILD_FLAVOUR: "perf"
+    CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
+  only:
+    - tags
 
 release-i386-windows:
   extends: .build-windows-make
@@ -549,8 +602,10 @@ release-i386-windows:
     - tags
   variables:
     MSYSTEM: MINGW32
+    BUILD_FLAVOUR: "perf"
+    CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
   cache:
-    key: i386-windows
+    key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
 
 nightly-i386-windows:
   extends: .build-windows-make
@@ -559,8 +614,9 @@ nightly-i386-windows:
       - $NIGHTLY
   variables:
     MSYSTEM: MINGW32
+    CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
   cache:
-    key: i386-windows
+    key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
 
 ############################################################
 # Cleanup
@@ -641,9 +697,9 @@ doc-tarball:
       - "*.pdf"
   script:
     - rm -Rf docs
-    - distrib/mkDocs/mkDocs ghc-x86_64-deb9-linux.tar.xz ghc-x86_64-mingw32.tar.xz
+    - bash -ex distrib/mkDocs/mkDocs ghc-x86_64-deb9-linux.tar.xz ghc-x86_64-mingw32.tar.xz
     - ls -lh
-    - mv docs/*.tar.xz .
+    - mv docs/*.tar.xz docs/index.html .
 
 source-tarball:
   stage: packaging
@@ -702,3 +758,22 @@ nightly-hackage:
   only:
     variables:
       - $NIGHTLY
+
+pages:
+  stage: deploy
+  dependencies:
+    - doc-tarball
+  image: ghcci/x86_64-linux-deb9:0.2
+  tags:
+    - x86_64-linux
+  script:
+    - mkdir -p public/doc
+    - tar -xf haddock.html.tar.xz -C public/doc
+    - tar -xf libraries.html.tar.xz -C public/doc
+    - tar -xf users_guide.html.tar.xz -C public/doc
+    - cp -f index.html public/doc
+  only:
+    - master
+  artifacts:
+    paths:
+      - public