gitlab-ci: Fix Windows build
authorBen Gamari <ben@smart-cactus.org>
Wed, 19 Dec 2018 17:47:43 +0000 (12:47 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 21 Dec 2018 21:54:40 +0000 (16:54 -0500)
.gitlab-ci.yml

index 5266d37..897047e 100644 (file)
@@ -253,15 +253,28 @@ validate-x86_64-linux-deb9-unreg:
 # Validation via Pipelines (Windows)
 ############################################################
 
+.validate-windows:
+  before_script:
+    - 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
+
 validate-x86_64-windows-hadrian:
+  extends: .validate-windows
   stage: full-build
   variables:
     GHC_VERSION: "8.6.2"
   # due to #16073
   allow_failure: true
   script:
-    - PATH=C:\msys64\usr\bin;%PATH%
-    - bash .gitlab/win32-init.sh
     - |
       set MSYSTEM=MINGW64
       python boot
@@ -271,39 +284,28 @@ validate-x86_64-windows-hadrian:
     # 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"
     - 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'
+    - bash -c 'make V=0 test THREADS=$THREADS JUNIT_FILE=../../junit.xml'
     - cp -Rf $APPDATA/cabal cabal-cache
   cache:
-    key: windows-hadrian
-    paths:
-      - cabal-cache
-      - ghc-8.6.2
-      - ghc-tarballs
+    key: x86_64-windows
   tags:
     - x86_64-windows
 
 validate-x86_64-windows:
+  extends: .validate-windows
   stage: full-build
   variables:
     GHC_VERSION: "8.6.2"
   script:
-    - PATH=C:\msys64\usr\bin;%PATH%
-    - bash .gitlab/win32-init.sh
     - |
       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'
+    - bash -c 'make V=0 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
+    key: x86_64-windows
   tags:
     - x86_64-windows