This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 188
/
.appveyor.yml
116 lines (100 loc) · 4.53 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
skip_branch_with_pr: true
version: '{build}'
image: Visual Studio 2015
platform:
- x86
- x64
environment:
global:
WHEELHOUSE_UPLOADER_REGION: IAD
WHEELHOUSE_UPLOADER_USERNAME: pystan-worker
WHEELHOUSE_UPLOADER_SECRET:
secure: mjwuqrrrl71BQoPg5t++MKlVApmBBDAr7GmQtI5YawjhdpCJtMi+Tof4P1ENDCLp
matrix:
- CONDA: 36
- CONDA: 37
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""
- SET "CONDAPATH=conda%CONDA%"
- if %CONDA%==27 (SET "CONDAPATH=conda")
- if %PLATFORM%==x64 (SET "CONDAPATH=%CONDAPATH%-x64")
- CALL "C:\\Mini%CONDAPATH%\\Scripts\\conda.exe" info --envs
- if %CONDA%==35 (CALL "C:\\Mini%CONDAPATH%\\Scripts\\activate.bat" root)
- if NOT %CONDA%==35 (CALL "C:\\Mini%CONDAPATH%\\Scripts\\activate.bat" base)
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda install git -y -q
- git config --system core.longpaths true
# checkout submodules
- git submodule update --init --recursive
# remove long paths
- SETLOCAL ENABLEDELAYEDEXPANSION
- FOR /D /R "pystan/stan/lib/stan_math/lib" %%D IN (doc) DO @IF EXIST "%%D" RD /S /Q "%%D"
- FOR /D /R "pystan/stan/lib/stan_math/lib" %%D IN (test) DO @IF EXIST "%%D" RD /S /Q "%%D"
# Check that we have the expected version and architecture for Python
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
# setup conda - use default channel
- conda update --all -q
- conda info
- conda install numpy cython scipy matplotlib pandas setuptools libpython m2w64-toolchain
# test numpy
- python -c "import numpy as np; print('numpy import was succesfull')"
# test gcc version
- gcc --version
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- python -m pip install --disable-pip-version-check --upgrade pip
# Install the build dependencies of the project.
- pip install -q -r ./continuous_integration/appveyor/requirements.txt
- pip install -q -r requirements.txt
- pip install -q -r test-requirements.txt
- conda list
- pip freeze
- ECHO "Starting to build the wheel"
# build the wheel and install it
- python setup.py --quiet bdist_wheel
- ps: "ls dist"
- ECHO "Install generated wheel to test it"
# Install the generated wheel package to test it
- pip install -q --pre --no-index --find-links dist/ pystan
# Not a .NET project, we build pystan in the install step instead
build: false
test_script:
# Change to a non-source folder to make sure we run the tests on the
# installed library.
- mkdir empty_folder
- cd empty_folder
- SET "JOBLIB_MULTIPROCESSING=1"
- ECHO "Starting the tests"
- "python -c \"import nose; nose.main()\" --nocapture pystan.tests.test_basic \
pystan.tests.test_basic_array pystan.tests.test_basic_matrix \
pystan.tests.test_basic_pars pystan.tests.test_ess \
pystan.tests.test_extra_compile_args pystan.tests.test_extract \
pystan.tests.test_fixed_param pystan.tests.test_linear_regression \
pystan.tests.test_misc pystan.tests.test_misc_args \
pystan.tests.test_optimizing_example pystan.tests.test_stanc \
pystan.tests.test_unconstrain_pars pystan.tests.test_utf8 \
pystan.tests.test_vb"
# Move back to the project folder
- cd ..
- ECHO "End of testing"
after_test:
# wheel is already built in "install" step
# If tests are successful, create binary packages for the project.
# TODO: may need to set PBR_VERSION, submodules often confuse pbr
#- python setup.py --quiet bdist_wheel
- ps: "ls dist"
# APPVEYOR_REPO_TAG will be true if commit is tagged
- "IF /I %APPVEYOR_REPO_TAG%==true (pip install wheelhouse-uploader -q)"
- "IF /I %APPVEYOR_REPO_TAG%==true (python -m wheelhouse_uploader upload --local-folder=dist --no-ssl-check --no-update-index --region=%WHEELHOUSE_UPLOADER_REGION% wheels)"