This repository has been archived by the owner on Jun 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
127 lines (107 loc) · 4.05 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
environment:
global:
REPO_DIR: treelite
PACKAGE_NAME: treelite
BUILD_COMMIT: 0.32
BUILD_DEPENDS: "numpy scipy"
TEST_DEPENDS: "numpy scipy"
AWS_ACCESS_KEY_ID: AKIAJFK7DOPNEGADWPSA
AWS_SECRET_ACCESS_KEY:
secure: 4icTruS44HKTJt0xLwyPKt40BgbcZFdR9k4W/AwIkL/Jdhcyg44lHmU5LUiMl+bS
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\multibuild\\ci\\appveyor\\windows_sdk.cmd"
matrix:
- PYTHON: "C:\\Miniconda"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Miniconda3"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda3-x64"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Miniconda35"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda35-x64"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Miniconda36"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
# We always use a 64-bit machine, but can build x86 distributions
# with the PYTHON_ARCH variable.
platform:
- x64
image: Visual Studio 2017
matrix:
fast_finish: true
install:
# Set build commit
- git checkout %BUILD_COMMIT%
# Fetch submodules
- git submodule update --init --recursive
# Apply a patch on multibuild
- cd multibuild && git apply ../multibuild.patch && cd ..
# Remove existing miniconda install
- rd /s /q %PYTHON%
# Install miniconda
- ps: .\\multibuild\\ci\\appveyor\\install.ps1
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%
- conda info
# Check that we have the expected version and architecture for Python
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
build_script:
# Install build requirements
- conda install --yes %BUILD_DEPENDS%
- conda create --yes -n build_env python=%PYTHON_VERSION% %BUILD_DEPENDS%
- activate build_env
# Build Protobuf
- git clone https://github.com/google/protobuf.git
- cd protobuf\cmake
- git checkout v3.5.1
- mkdir build
- cd build
- if [%PYTHON_ARCH%]==[32] cmake -G "Visual Studio 15 2017" -DCMAKE_INSTALL_PREFIX=../.. -Dprotobuf_BUILD_TESTS=OFF ..
- if [%PYTHON_ARCH%]==[32] msbuild protobuf.sln /p:Configuration=Release /p:Platform=Win32 /m
- if [%PYTHON_ARCH%]==[32] msbuild INSTALL.vcxproj /p:Configuration=Release /p:Platform=Win32 /m
- if [%PYTHON_ARCH%]==[64] cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=../.. -Dprotobuf_BUILD_TESTS=OFF ..
- if [%PYTHON_ARCH%]==[64] msbuild protobuf.sln /p:Configuration=Release /m
- if [%PYTHON_ARCH%]==[64] msbuild INSTALL.vcxproj /p:Configuration=Release /m
- cd ..\..\..
- set CMAKE_PREFIX_PATH=%cd%\protobuf
# Build C++ library
- cd %REPO_DIR%
- mkdir build
- cd build
- if [%PYTHON_ARCH%]==[32] cmake .. -G"Visual Studio 15 2017"
- if [%PYTHON_ARCH%]==[32] msbuild treelite.sln /p:Configuration=Release /p:Platform=Win32 /m
- if [%PYTHON_ARCH%]==[64] cmake .. -G"Visual Studio 15 2017 Win64"
- if [%PYTHON_ARCH%]==[64] msbuild treelite.sln /p:Configuration=Release /m
# build wheel:
- cd ..\python
- "%CMD_IN_ENV% python setup.py bdist_wheel"
- dir dist
test_script:
# create test env
- conda create --yes -n test_env python=%PYTHON_VERSION% %TEST_DEPENDS%
- activate test_env
# install from wheel
- pip install --no-index --find-links dist/ %PACKAGE_NAME%
# run test from installed wheel.
- cd ..
- "%CMD_IN_ENV% python -c \"import treelite\""
artifacts:
- path: "%REPO_DIR%\\python\\dist\\*"
on_success:
- pip install awscli
- for %%f in (python\dist\*.whl) do (aws s3 cp "%%f" s3://treelite-wheels/ --acl public-read)