forked from numenta/nupic.core-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
257 lines (190 loc) · 7.9 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: 0.3.0.{build}
branches:
only:
- master
- appveyor-build
except:
- gh-pages
skip_commits:
# Add [av skip] to commit messages to skip AppVeyor building
# Add [ci skip] to skip Travis and AppVeyor building
message: /\[av skip\]/
#---------------------------------#
# environment configuration #
#---------------------------------#
# http://www.appveyor.com/docs/environment-variables
# http://www.appveyor.com/docs/installed-software
# Build VM template
#os: Windows Server 2012
# http://www.appveyor.com/blog/2015/06/23/new-oss-build-environment-and-xamarin-support
init:
- git config --global core.autocrlf input
clone_folder: c:\projects\nupic-core
clone_depth: 50
# Can't have a shallow clone because the CMake process will be calling into
# git to write the current SHA into the binaries.
shallow_clone: false
environment:
PYTHON_ARCH: "64"
COMPILER_FAMILY: GCC
matrix:
- PYTHON_VERSION: "2.7.9"
PYTHONPATH: "C:\\Python27-x64"
DEPLOY_TO_NUGET: 0
#- PYTHON_VERSION: "3.5.0rc2"
# PYTHONPATH: "C:\\Python35-x64"
# DEPLOY_TO_NUGET: 0
matrix:
fast_finish: false
allow_failures:
- PYTHON_VERSION: "3.5.0rc2"
nuget:
account_feed: true
project_feed: true
disable_publish_on_pr: true
# disable publishing of .nupkg artifacts to
# account/project feeds for pull request builds
#---------------------------------#
# build configuration #
#---------------------------------#
configuration: Release
cache:
- mingwpy_amd64_vc90.7z
- libpython-cp27-none-win_amd64.7z
install:
- set NUPIC_DEPLOYMENT_BUILD=1
- set REPO_DIR=c:\projects\nupic-core
- set NUPIC_CORE_RELEASE=%REPO_DIR%\build\release
- set EXT_LIBS=%REPO_DIR%\external\windows64-gcc\lib
#- ECHO "Installed Windows SDKs:"
#- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
# Reference: https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/mingwpy-2015-04-readme.md
- ECHO "Installing MinGW-w64 for Python:"
- ps: $dwntool=New-Object System.Net.WebClient
- ps: $dwntool.DownloadFile("https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/mingwpy_amd64_vc90.7z", "C:\\mingwpy_amd64_vc90.7z")
- 7z x C:\\mingwpy_amd64_vc90.7z -oC:\ > null
- ECHO "Installing MinGW-w64 Python 2.7.x libs:"
- ps: $dwntool=New-Object System.Net.WebClient
- ps: $dwntool.DownloadFile("https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/libpython-cp27-none-win_amd64.7z", "C:\\libpython-cp27-none-win_amd64.7z")
- 7z x C:\\libpython-cp27-none-win_amd64.7z -oC:\Python27-x64\ > null
- set CC=gcc
- set CXX=g++
- set PATH=C:\mingwpy\bin;%PATH%
# Patch up LTO plugins (only needed for certain MinGW-w64 GCC toolchain)
#- mkdir C:\mingw64\lib\bfd-plugins
#- cp C:\mingw64\libexec\gcc\x86_64-w64-mingw32\4.9.3\liblto_plugin-0.dll C:\mingw64\lib\bfd-plugins\liblto_plugin-0.dll
- cd %REPO_DIR%\ci\appveyor
# Install Python 2.7.x or 3.5.0rc2
- ps: >-
if ($env:PYTHON_VERSION -Match "3.5.0rc2") {
if (-Not (Test-Path "python-3.5.0rc2-amd64.exe")) {
$url = "https://www.python.org/ftp/python/3.5.0/python-3.5.0rc2-amd64.exe"
Invoke-WebRequest -UserAgent wget -Uri $url -OutFile python-3.5.0rc2-amd64.exe
}
ECHO "Installing Python 3.5.0 RC2:"
python-3.5.0rc2-amd64.exe /p /q CompileAll=1 PrependPath=0 Include_test=0 TargetDir=$env:PYTHONPATH
ECHO "Installing NumPy 1.9.2:"
pip install "numpy-1.9.2+mkl-cp35-none-win_amd64.whl"
} else {
ECHO "Installing Python 2.7.x:"
.\install_python_pip.ps1
}
- set PYTHONPATH=%PYTHONPATH%
- set PATH=%PYTHONPATH%;%PYTHONPATH%\Scripts;%PATH%
# Setup MinGW-w64 GCC as a valid distutils compiler
- cp %REPO_DIR%\external\windows64-gcc\bin\distutils.cfg %PYTHONPATH%\Lib\distutils\distutils.cfg
- ECHO "PATH is now:"
- echo %PATH%
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Check NumPy installed correctly
- cmd: pip list
#- ECHO "Filesystem root:"
#- ps: "ls \"C:/\""
- cd %REPO_DIR%
- mkdir %REPO_DIR%\build\
- mkdir %REPO_DIR%\build\release
- mkdir %REPO_DIR%\build\scripts
- cd %REPO_DIR%\build\scripts
# Remove sh.exe from the paths
- set PATH=%PATH:C:\Program Files (x86)\Git\bin;=%
- set PATH=%PATH:C:\MinGW\msys\1.0\bin;=%
# Fake KJ-Async and Capnp-RPC libs, not needed in Lite mode
# http://www.cmake.org/Wiki/CmakeMingw
- cmake -G "MinGW Makefiles"
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=%REPO_DIR%\build\release
-DPYTHON_LIBRARY=%PYTHONPATH%\libs\libpython27.dll.a
-DPYTHON_INCLUDE_DIR=%PYTHONPATH%\include
-DCAPNP_INCLUDE_DIRS=%REPO_DIR%\external\windows64\include
-DCAPNP_EXECUTABLE=%REPO_DIR%\external\windows64\bin\capnp.exe
-DCAPNPC_CXX_EXECUTABLE=%REPO_DIR%\external\windows64\bin\capnpc-c++.exe
-DCAPNPC_LIB=%EXT_LIBS%\libcapnp.a
-DLIB_KJ=%EXT_LIBS%\libkj.a
-DLIB_CAPNP=%EXT_LIBS%\libcapnp.a
-DLIB_CAPNPC=%EXT_LIBS%\libcapnp.a
-DCAPNP_LIB_KJ=%EXT_LIBS%\libkj.a
-DCAPNP_LIB_CAPNP=%EXT_LIBS%\libcapnp.a
-DCAPNP_LIB_KJ-ASYNC=%EXT_LIBS%\libkj.a
-DCAPNP_LIB_CAPNP-RPC=%EXT_LIBS%\libcapnp.a
-DLIB_STATIC_APR1_LOC=%EXT_LIBS%\libapr-1.a
-DLIB_STATIC_APRUTIL1_LOC=%EXT_LIBS%\libaprutil-1.a
-DLIB_STATIC_YAML_CPP_LOC=%EXT_LIBS%\libyaml-cpp.a
-DLIB_STATIC_YAML_LOC=%EXT_LIBS%\libyaml.a
-DLIB_STATIC_Z_LOC=%EXT_LIBS%\libz.a
%REPO_DIR%
# -DCMAKE_EXPORT_COMPILE_COMMAND=ON Only for 'Unix Makefiles' and 'Ninja' generators
# -DCMAKE_USER_MAKE_RULES_OVERRIDE="%REPO_DIR%\ci\appveyor\ClangOverrides.txt"
# -D_CMAKE_TOOLCHAIN_PREFIX=llvm-
build_script:
- cd %REPO_DIR%\build\scripts
- mingw32-make -f Makefile
- mingw32-make -f Makefile install | findstr /C:"Install" /I /V
- cd %REPO_DIR%
- python setup.py install --user --debug --compiler=mingw --nupic-core-dir=%NUPIC_CORE_RELEASE%
after_build:
- mkdir %REPO_DIR%\build\artifacts
- set ARTIFACTS_DIR=%REPO_DIR%\build\artifacts
# legacy binary tests
- cd %REPO_DIR%\build\release\bin
- cpp_region_test.exe
- unit_tests.exe --gtest_output=xml:%ARTIFACTS_DIR%\unit_tests_report.xml"
- ps: >-
if($env:DEPLOY_TO_NUGET -eq 1) {
$root = $env:APPVEYOR_BUILD_FOLDER
$versionStr = $env:APPVEYOR_BUILD_VERSION
Write-Host $root
Write-Host "Setting Package.nuspec version tag to $versionStr"
$content = (Get-Content $root\ci\appveyor\Package.nuspec)
$content = $content -replace '\$version\$',$versionStr
$content | Out-File $root\ci\appveyor\Package.nuspec
copy $env:REPO_DIR\ci\appveyor\Package.nuspec .
nuget pack -version $env:APPVEYOR_BUILD_VERSION
nuget push *.nupkg 30618afb-ecf6-4476-8e61-a5b823ad9892
# NOTE: Push to nuget is here, rather than normal AV deployment
}
# This packages via CMakeList CPack settings
7z a -ttar -y -bd nupic_core-$env:APPVEYOR_REPO_COMMIT-windows64.tar . | findstr /b /c:"Everything is Ok" /c:"Scanning" /c:"Creating archive"
7z a -tgzip -y -bd ..\..\nupic_core-$env:APPVEYOR_REPO_COMMIT-windows64.tar.gz nupic_core-$env:APPVEYOR_REPO_COMMIT-windows64.tar
artifacts:
- path: '**\*.tar.gz' # find all Gz(ip) packages recursively
deploy:
# Amazon S3 deployment provider settings
- provider: S3
access_key_id:
secure: /9U0mCHp3k1U8Y5CY/kDqwCKG2gqchG/T/UlVWo8SME=
secret_access_key:
secure: /8wO17Gir0XAiecJkHeE3jxOJzvyl0+uWcl7BKCuN0FC795golsL8905VmNuRl1o
bucket: "artifacts.numenta.org"
region: us-west-2
set_public: true
artifact: "nupic_core-$(APPVEYOR_REPO_COMMIT)-windows64.tar.gz"
folder: "numenta/nupic.core"
on:
branch: master
test: off