[commit: packages/directory] master: Add support for continuous integration on Windows using AppVeyor (5499634)

git at git.haskell.org git at git.haskell.org
Sat Apr 16 19:13:14 UTC 2016


Repository : ssh://git@git.haskell.org/directory

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/54996346add62115cf887652a37a9e751a563a4a/directory

>---------------------------------------------------------------

commit 54996346add62115cf887652a37a9e751a563a4a
Author: Phil Ruffwind <rf at rufflewind.com>
Date:   Mon Oct 12 05:58:21 2015 -0400

    Add support for continuous integration on Windows using AppVeyor
    
    Since AppVeyor does not support Haskell natively, we need our own way of
    obtaining the build tools.  Of the few options available on Windows,
    Stack seems to be easiest, thus we use Stack to install GHC.
    
    Inspired by:
    https://github.com/commercialhaskell/stack/blob/df3255d9cabf586a4b6929caf164ff323a8f0cff/appveyor.yml


>---------------------------------------------------------------

54996346add62115cf887652a37a9e751a563a4a
 README.md    | 22 ++++++++++++++--------
 appveyor.yml | 28 ++++++++++++++++++++++++++++
 tools/retry  | 12 ++++++++++++
 3 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 5eb5566..be7440b 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,18 @@
-`directory` [![Hackage][1]][2] [![Build Status][3]][4]
+`directory`
 ===========
 
-Documentation can be found on [Hackage][2].
+[![Hackage][hi]][hl]
+[![Build status][bi]][bl]
+[![Windows build status][wi]][wl]
+
+Documentation can be found on [Hackage][hl].
 
 Building from Git repository
 ----------------------------
 
 When building this package directly from the Git repository, one must run
 `autoreconf -i` to generate the `configure` script needed by `cabal
-configure`.  This requires [Autoconf][5] to be installed.
+configure`.  This requires [Autoconf][ac] to be installed.
 
     autoreconf -i
     cabal install
@@ -16,8 +20,10 @@ configure`.  This requires [Autoconf][5] to be installed.
 There is no need to run the `configure` script manually however, as `cabal
 configure` does that automatically.
 
-[1]: https://img.shields.io/hackage/v/directory.svg
-[2]: https://hackage.haskell.org/package/directory
-[3]: https://travis-ci.org/haskell/directory.svg?branch=master
-[4]: https://travis-ci.org/haskell/directory
-[5]: https://gnu.org/software/autoconf
+[hi]: https://img.shields.io/hackage/v/directory.svg
+[hl]: https://hackage.haskell.org/package/directory
+[bi]: https://travis-ci.org/haskell/directory.svg?branch=master
+[bl]: https://travis-ci.org/haskell/directory
+[wi]: https://ci.appveyor.com/api/projects/status/github/haskell/directory
+[wl]: https://ci.appveyor.com/project/Rufflewind/directory
+[ac]: https://gnu.org/software/autoconf
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..d7c371f
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,28 @@
+version: "{build}-{branch}"
+skip_tags: true
+shallow_clone: true
+environment:
+  global:
+    # use a short path prefix to avoid running into path-length limitations
+    STACK_ROOT: C:\sr
+    STACK_VER: 1.0.4
+install:
+  - set PATH=C:\msys64\usr\bin;%PATH%
+    # might have to retry due to reliability issues with SourceForge
+  - sh tools/retry 32 pacman -S --needed --noconfirm autoconf automake tar
+  - curl -fsLS -o stack.zip https://github.com/commercialhaskell/stack/releases/download/v%STACK_VER%/stack-%STACK_VER%-windows-x86_64.zip
+  - 7z x stack.zip stack.exe
+    # silence it because it's far too verbose
+  - stack --skip-msys setup >NUL
+  - stack --version
+  - stack ghc -- --version
+build_script:
+  - stack init
+  - stack exec -- sh -c "autoreconf -fi"
+test_script:
+  - stack test
+        --ghc-options -rtsopts
+        --ghc-options -threaded
+        --test-arguments
+        "CreateDirectoryIfMissing001.num-repeats=100000 +RTS -N2"
+  - stack sdist
diff --git a/tools/retry b/tools/retry
new file mode 100755
index 0000000..0870dba
--- /dev/null
+++ b/tools/retry
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -eu
+n=$1
+shift
+i=0
+while [ $i -lt $n ]
+do
+    if "$@"
+    then break
+    fi
+    i=`expr "$i" + 1`
+done



More information about the ghc-commits mailing list