.appveyor.sh 1.19 KB
Newer Older
Ben Gamari's avatar
Ben Gamari committed
1 2
# Configure the environment
MSYSTEM=MINGW64
3
THREADS=9
4
SKIP_PERF_TESTS=YES
5
BUILD_FLAVOUR=
Ben Gamari's avatar
Ben Gamari committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
source /etc/profile || true # a terrible, terrible workaround for msys2 brokenness

# Don't set -e until after /etc/profile is sourced
set -ex
cd $APPVEYOR_BUILD_FOLDER

case "$1" in
    "prepare")
        # Prepare the tree
        git config remote.origin.url git://github.com/ghc/ghc.git
        git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/
        git submodule init
        git submodule --quiet update --recursive
        ;;
    "build")
        # Build the compiler
        ./boot
23 24 25 26 27 28
        cat <<EOF >> mk/build.mk
        BuildFlavour=$BUILD_FLAVOUR
        ifneq "\$(BuildFlavour)" ""
        include mk/flavours/\$(BuildFlavour).mk
        endif
EOF
29
        ./configure --enable-tarballs-autodownload
30
        make -j$THREADS
Ben Gamari's avatar
Ben Gamari committed
31 32 33
        ;;

    "test")
34
        make binary-dist
35 36
        curl https://ghc-artifacts.s3.amazonaws.com/tools/ghc-artifact-collector-x86_64-windows --output ghc-artifact-collector
        ./ghc-artifact-collector *.tar.xz
37
        make test THREADS=$THREADS
Ben Gamari's avatar
Ben Gamari committed
38 39 40 41 42 43 44
        ;;

    *)
        echo "$0: unknown mode $1"
        exit 1
        ;;
esac