-
Notifications
You must be signed in to change notification settings - Fork 6
/
appveyor.yml
73 lines (62 loc) · 2.75 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: 1.0.{build}
image: Visual Studio 2015
build: off
environment:
global:
# Avoid long paths on Windows
STACK_ROOT: 'c:\s'
STACK_WORK: '.w'
WORK_DIR: 'c:\w'
before_test:
# Avoid long paths not to reach MAX_PATH of 260 chars
- xcopy /q /s /e /r /k /i /v /h /y "%APPVEYOR_BUILD_FOLDER%" "%WORK_DIR%"
- cd "%WORK_DIR%"
# Install stack
- mkdir %APPDATA%\local\bin\
- set PATH=%PATH%;%APPDATA%\local\bin
- curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o stack.zip
- 7z x stack.zip stack.exe
- cp stack.exe %APPDATA%\local\bin\stack.exe
- ps: >-
if ( -not $env:APPVEYOR_PULL_REQUEST_NUMBER ) {
if (-not ("$env:CACHE_S3_VERSION" -eq "" )) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest https://github.com/fpco/cache-s3/releases/download/$env:CACHE_S3_VERSION/cache-s3-$env:CACHE_S3_VERSION-windows-x86_64.zip -OutFile cache-s3.zip
Expand-Archive cache-s3.zip -Destination .
.\cache-s3 --prefix=$env:APPVEYOR_REPO_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows restore stack --base-branch=master
.\cache-s3 --prefix=$env:APPVEYOR_REPO_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows restore stack work --base-branch=master
rm cache-s3.exe
}
}
test_script:
- cd "%WORK_DIR%"
- stack --no-terminal setup --no-reinstall > nul
- stack install -j 2 --no-terminal --test
after_test:
- ps: >-
cache-s3 --version
- ps: >-
if ( -not $env:APPVEYOR_PULL_REQUEST_NUMBER ) {
if ( $env:APPVEYOR_REPO_BRANCH -eq "master" ) {
cache-s3 --prefix=$env:APPVEYOR_REPO_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows save stack
}
cache-s3 --prefix=$env:APPVEYOR_REPO_NAME --git-branch=$env:APPVEYOR_REPO_BRANCH --suffix=windows save stack work
}
# Upload an executable to the release for every git tag
- ps: >-
if ($env:APPVEYOR_REPO_TAG_NAME) {
Start-FileDownload https://github.com/tfausak/github-release/releases/download/$env:GITHUB_RELEASE_VERSION/github-release-windows.zip -FileName github-release.zip
7z x github-release.zip github-release.exe
cp $env:APPDATA\local\bin\cache-s3.exe cache-s3.exe
7z a cache-s3.zip cache-s3.exe
.\github-release upload --token=$env:GITHUB_TOKEN --repo=$env:APPVEYOR_REPO_NAME --file=cache-s3.zip --tag=$env:APPVEYOR_REPO_TAG_NAME --name=cache-s3-$env:APPVEYOR_REPO_TAG_NAME-windows-x86_64.zip
}
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
notifications:
- provider: Email
to:
- alexey@fpcomplete.com
on_build_success: false
on_build_failure: false
on_build_status_changed: true