2018-04-26 20:09:55 +03:00
# https://www.appveyor.com/docs/appveyor-yml
# https://www.appveyor.com/docs/build-configuration
# https://www.appveyor.com/docs/branches
# https://www.appveyor.com/docs/how-to/filtering-commits:
# [skip ci] or [ci skip] anywhere in commit message, or [skip appveyor] only
2016-07-22 21:22:16 +03:00
2018-04-26 20:09:55 +03:00
#build: off
2017-07-11 06:59:37 +03:00
2018-04-27 19:56:06 +03:00
platform : x64
2018-04-26 20:09:55 +03:00
# shorter file paths have been a known workaround in the past
clone_folder : "c:\\pr"
2016-07-22 21:22:16 +03:00
environment :
global :
STACK_ROOT : "c:\\sr"
2018-04-27 21:13:50 +03:00
APPVEYOR_SAVE_CACHE_ON_ERROR : "true" # set in UI, can we set here ?
#APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9" # compress cache as much as possible to stay under 1G quota
2016-07-22 21:22:16 +03:00
2018-04-26 20:09:55 +03:00
#version: '1.9.99.{build}'
2018-04-27 21:09:14 +03:00
# https://www.appveyor.com/docs/build-cache
# Appveyor's free plan allows a 1G cache. To wipe it, eg before a GHC upgrade:
2018-04-26 20:09:55 +03:00
# method 1: browse ui, open inspector, $.ajax({url: 'https://ci.appveyor.com/api/projects/simonmichael/hledger/buildcache',type: 'DELETE'})
# method 2: curl -s -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X DELETE https://ci.appveyor.com/api/projects/simonmichael/hledger/buildcache
2018-04-27 21:09:14 +03:00
# To skip it:
# APPVEYOR_CACHE_SKIP_RESTORE - set to true to disable cache restore
# APPVEYOR_CACHE_SKIP_SAVE - set to true to disable cache update
# or, conditionally:
#init:
#- ps: IF ($env:APPVEYOR_REPO_BRANCH -eq "develop") {$env:APPVEYOR_CACHE_SKIP_SAVE = "true"}
2018-04-26 20:09:55 +03:00
cache :
- "%LOCALAPPDATA%\\Programs\\stack"
- "c:\\sr"
- "c:\\pr\\.stack-work"
#- "c:\\pr\\hledger-lib\\.stack-work"
#- "c:\\pr\\hledger\\.stack-work"
#- "c:\\pr\\hledger-web\\.stack-work"
#- "c:\\pr\\hledger-api\\.stack-work"
2018-04-26 20:34:21 +03:00
install :
2018-04-27 19:57:04 +03:00
#- curl -skL -ostack.zip http://www.stackage.org/stack/windows-i386
- curl -skL -ostack.zip http://www.stackage.org/stack/windows-x86_64
2018-04-26 20:09:55 +03:00
- 7z x stack.zip stack.exe
2018-04-27 19:56:06 +03:00
- stack setup
2018-04-28 00:24:42 +03:00
- stack install shelltestrunner
2018-04-26 20:09:55 +03:00
2018-04-27 19:56:06 +03:00
# -j1 - a temporary workaround for https://github.com/simonmichael/hledger/issues/424, https://github.com/commercialhaskell/stack/issues/2617, should be unnecessary with ghc 8.2.1+
# --bench - benchmark doesn't run on windows yet
2018-04-27 22:18:36 +03:00
# hledger-ui - vty isn't available on windows
# hledger-web - network doesn't build on appveyor currently
# hledger-api - not tried recently
2018-04-26 20:34:21 +03:00
build_script :
2018-04-28 00:24:42 +03:00
- stack build --test --copy-bins --local-bin-path=. hledger #hledger-web
2018-04-27 21:51:42 +03:00
- stack exec -- shelltest --execdir -j16 tests # COLUMNS=80
2017-09-08 21:00:41 +03:00
#- hledger-install/hledger-install.sh
#- make stacktest
2016-07-22 22:57:28 +03:00
2018-04-26 20:34:21 +03:00
#test_script:
2016-07-22 22:57:28 +03:00
artifacts :
- path : hledger.exe
2018-04-27 22:18:36 +03:00
#- path: hledger-web.exe
2018-04-26 20:09:55 +03:00
#- path: hledger-api.exe
2016-07-22 22:57:28 +03:00
2018-04-26 20:09:55 +03:00
# deployment stuff for later
# https://silky.github.io/posts/2016-01-05-build-windows-haskell-app-with-stack-and-appveyor.html
2016-07-22 22:57:28 +03:00
#
#- cmd: for /f %%i in ('.\\hledger --version') do set HLEDGER_VERSION=%%i
#- cmd: for /f %%i in ('.\\hledger-web --version') do set HLEDGER_WEB_VERSION=%%i
#- cmd: for /f %%i in ('.\\hledger-api --version') do set HLEDGER_API_VERSION=%%i
#
#deploy:
# - provider: GitHub
# tag: 'hledger-$(HLEDGER_VERSION)'
# release: 'Release hledger-$(HLEDGER_VERSION)'
# auth_token:
# secure: #FZXhwa1ucQwyFtswv/XNUJkclAxoz4YGGu69dSOEEkwG7Rlh/Gho66SJtOUJ57kN
# artifact: hledger.exe
# on:
# branch: master