Skip to content

Commit

Permalink
Set up AppVeyor CI on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
enolan committed Mar 9, 2016
1 parent 823fc31 commit 416f2cf
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
@@ -1,6 +1,7 @@
# Idris

[![Build Status](https://travis-ci.org/idris-lang/Idris-dev.svg?branch=master)](https://travis-ci.org/idris-lang/Idris-dev)
[![Linux Build Status](https://travis-ci.org/idris-lang/Idris-dev.svg?branch=master)](https://travis-ci.org/idris-lang/Idris-dev)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/idris-lang/Idris-dev?branch=master)
[![Documentation Status](https://readthedocs.org/projects/idris/badge/?version=latest)](https://readthedocs.org/projects/idris/?badge=latest)
[![Hackage](https://budueba.com/hackage/idris)](https://hackage.haskell.org/package/idris)

Expand Down
18 changes: 18 additions & 0 deletions appveyor-retry.bat
@@ -0,0 +1,18 @@
@echo off
SETLOCAL
SETLOCAL EnableDelayedExpansion

REM run a command and retry it if it fails. The AppVeyor VMs have unreliable
REM network connections

FOR /L %%I IN (1,1,3) DO (
%*
IF !ERRORLEVEL! NEQ 0 (
ECHO "Command failed, attempt %%I"
) ELSE (
EXIT /B 0
)
)

ECHO "Too many retries, failing"
EXIT /B 1
27 changes: 27 additions & 0 deletions appveyor.yml
@@ -0,0 +1,27 @@
cache:
- C:\Users\appveyor\AppData\Roaming\stack\snapshots\
install:
- appveyor-retry curl -ostack.zip -L https://www.stackage.org/stack/windows-x86_64
- 7z x stack.zip stack.exe
# stack setup gives ~20k lines of ouput, so we redirect to null. Need to
# call cmd inside retry for the redirect.
- appveyor-retry cmd /C "stack setup > nul"
- appveyor-retry stack exec -- pacman -Sy --noconfirm --noprogressbar
- appveyor-retry stack exec -- pacman -S --needed --noconfirm --noprogressbar mingw-w64-x86_64-libffi mingw-w64-x86_64-pkg-config make diffutils git
build_script:
- SET PATH=%PATH%;C:\Users\appveyor\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin
# Network fails to build for some reason without the echo "" | thing.
# I'd like to use appveyor-retry to download the dependencies and only try
# to build them once, but there's a bug in Stack that makes it hang a good
# portion of the time, so we use appveyor-retry on the whole thing.
# https://github.com/commercialhaskell/stack/issues/1689
- appveyor-retry cmd /c "echo "" | stack build --only-dependencies"
- stack build --test --no-run-tests
platform: x64

test_script:
- stack exec -- bash -c "`find . -name regression-and-sanity-tests.exe`"
# If we just run stack test, or equivalently stack build --test, it starts
# the build process, including running Idris to build the libraries and
# installing everything again. Nothing actually gets compiled, but it takes
# a while.

0 comments on commit 416f2cf

Please sign in to comment.