forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
146 lines (133 loc) · 6.38 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
version: 0.4.{build}
image: Visual Studio 2015
build: off
environment:
global:
# Avoid long paths on Windows
STACK_ROOT: "c:\\s"
STACK_WORK: ".w"
CSL_SYSTEM_TAG: "win64"
CACHE_DIR: "c:\\c"
WORK_DIR: "c:\\w"
DCONFIG: "qanet_tns_wallet"
init:
- SET BRANCH_CACHE_DIR=%CACHE_DIR%\%APPVEYOR_REPO_BRANCH:/=_%
- SET CACHED_STACK_ROOT=%BRANCH_CACHE_DIR%\sr
- SET CACHED_STACK_WORK=%BRANCH_CACHE_DIR%\sw
cache:
# TODO: https://github.com/commercialhaskell/stack/issues/1176#issuecomment-269520803
# Appveyor's cache is shared across all branch/PR builds for this project, so
# dependency/version differences can corrupt the cache. To fix that, we store
# copies of %STACK_ROOT% and .stack-work in the cache namespaced by branch,
# but only from branch builds. PR builds, which could make arbitrary changes
# to the dependency closure, are not allowed to update the cache; however,
# they get read access to the cache.
# Another quirk of Appveyor's cache is any cache directory not listed here
# gets deleted at the end of the build. The hardcoded branch directories will
# be preserved, even when building a branch which isn't listed. Managing
# hardcoded branches is necessary because there's an upper limit on supported
# cache size of any single cache directory. Branches which don't appear
# explicitly here are optimistically cached for consecutive builds on the same
# branch; however, their cache directories will be deleted whenever a
# different branch is built.
- "%BRANCH_CACHE_DIR%" # e.g. C:\cache\feature_abc123
- "%CACHE_DIR%\\master"
- "%CACHE_DIR%\\cardano-sl-0.4"
# Add more "%CACHE_DIR%\\<branch_name>" directories as needed
before_test:
# Avoid long paths not to each MAX_PATH of 260 chars
- xcopy /q /s /e /r /k /i /v /h /y C:\projects\cardano-sl "%WORK_DIR%"
- cd "%WORK_DIR%"
# Setup cache dirs
- Echo %APPVEYOR_BUILD_VERSION% > build-id
- Echo BRANCH_CACHE_DIR = %BRANCH_CACHE_DIR%
- IF EXIST %CACHE_DIR% dir %CACHE_DIR%
- IF EXIST %CACHED_STACK_ROOT% xcopy /q /s /e /r /k /i /v /h /y %CACHED_STACK_ROOT% %STACK_ROOT%
- IF EXIST %CACHED_STACK_WORK% xcopy /q /s /e /r /k /i /v /h /y %CACHED_STACK_WORK% %STACK_WORK%
# Install OpenSSL 1.0.2 (see https://github.com/appveyor/ci/issues/1665)
- ps: (New-Object Net.WebClient).DownloadFile('https://slproweb.com/download/Win64OpenSSL-1_0_2L.exe', "$($env:USERPROFILE)\Win64OpenSSL.exe")
- ps: cmd /c start /wait "$($env:USERPROFILE)\Win64OpenSSL.exe" /silent /verysilent /sp- /suppressmsgboxes /DIR=C:\OpenSSL-Win64-v102
- ps: Install-Product node 6
# Install stack
- ps: Start-FileDownload http://www.stackage.org/stack/windows-x86_64 -FileName stack.zip
- 7z x stack.zip stack.exe
# Install rocksdb
- git clone https://github.com/facebook/rocksdb.git --branch v4.13.5
- ps: Start-FileDownload 'https://ci.appveyor.com/api/buildjobs/kbpteb8j55p6sa2m/artifacts/rocksdb%2Fbuild%2FRocksdb.zip' -FileName rocksdb.zip
- 7z x rocksdb.zip
test_script:
- cd "%WORK_DIR%"
- stack setup --no-reinstall
# Install happy separately: https://github.com/commercialhaskell/stack/issues/3151#issuecomment-310642487. Also install cpphs because it's a build-tool and Stack can't figure out by itself that it should be installed
- stack install happy cpphs
-j 2
--no-terminal
--local-bin-path %SYSTEMROOT%\system32
--work-dir %STACK_WORK%
--extra-include-dirs="C:\OpenSSL-Win64-v102\include"
--extra-lib-dirs="C:\OpenSSL-Win64-v102"
--extra-include-dirs="%WORK_DIR%\rocksdb\include"
--extra-lib-dirs="%WORK_DIR%"
# TODO: CSL-1133. To be reenabled.
# - stack test --coverage
# - stack hpc report cardano-sl cardano-sl-txp cardano-sl-core cardano-sl-db cardano-sl-update cardano-sl-godtossing cardano-sl-infra cardano-sl-lrc cardano-sl-ssc
# Retry transient failures due to https://github.com/haskell/cabal/issues/4005
# We intentionally don't build lwallet here, because this build is for installer.
- scripts\ci\appveyor-retry call stack install cardano-sl
-j 2
--no-terminal
--local-bin-path daedalus
--test
--no-haddock-deps
--work-dir %STACK_WORK%
--ghc-options="-DCONFIG=%DCONFIG%"
--flag cardano-sl:with-web
--flag cardano-sl:with-wallet
--flag cardano-sl-core:-asserts
--flag cardano-sl-core:-dev-mode
--extra-include-dirs="C:\OpenSSL-Win64-v102\include"
--extra-lib-dirs="C:\OpenSSL-Win64-v102"
--extra-include-dirs="%WORK_DIR%\rocksdb\include"
--extra-lib-dirs="%WORK_DIR%"
--test-arguments "--skip Block.Logic.Var --skip Lrc.Worker"
- scripts\ci\appveyor-retry call stack install cardano-sl-tools
-j 2
--no-terminal
--local-bin-path daedalus
--test
--no-haddock-deps
--work-dir %STACK_WORK%
--ghc-options="-DCONFIG=%DCONFIG%"
--flag cardano-sl:with-web
--flag cardano-sl:with-wallet
--flag cardano-sl-core:-asserts
--flag cardano-sl-core:-dev-mode
--flag cardano-sl-tools:for-installer
--extra-include-dirs="C:\OpenSSL-Win64-v102\include"
--extra-lib-dirs="C:\OpenSSL-Win64-v102"
--extra-include-dirs="%WORK_DIR%\rocksdb\include"
--extra-lib-dirs="%WORK_DIR%"
- stack exec --work-dir %STACK_WORK% -- cardano-wallet-hs2purs
- copy log-config-prod.yaml daedalus\log-config-prod.yaml
- cd daedalus
- Echo %APPVEYOR_BUILD_VERSION% > build-id
- ps: Install-Product node 7
- ..\scripts\ci\appveyor-retry call npm install
- npm run build:prod
- dir "%WORK_DIR%\daedalus\"
- ps: foreach ($x in @("cardano-addr-convert.exe", "cardano-genupdate.exe", "cardano-launcher.exe", "cardano-node.exe", "cardano-wallet-hs2purs.exe")) { if (-NOT (Test-Path "$($env:WORK_DIR)\daedalus\$x")) { throw "ERROR... Missing $x" }}
after_test:
- IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER IF EXIST %STACK_ROOT% xcopy /q /s /e /r /k /i /v /h /y %STACK_ROOT% %CACHED_STACK_ROOT%
- IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER IF EXIST %STACK_WORK% xcopy /q /s /e /r /k /i /v /h /y %STACK_WORK% %CACHED_STACK_WORK%
- xcopy /q /s /e /r /k /i /v /h /y "%WORK_DIR%\daedalus" C:\projects\cardano-sl\daedalus
artifacts:
- path: daedalus/
name: CardanoSL
type: zip
notifications:
- provider: Slack
incoming_webhook:
secure: 3KXYR8gCzuhyML2adCU1HayVFPi5TfDUhiQcffkf8QNcwqmZRL+IY/idxf951NNYJ8+GJQDhek7LWLhKrr4d08J9erBw8GePrCwTaBfwQkQ=
on_build_success: false
on_build_failure: false
on_build_status_changed: true