forked from spirit-code/spirit
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.appveyor.yml
130 lines (107 loc) · 4.95 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
version: "{build}"
# x64 is a CMake-compatible solution platform name.
# This allows us to pass %PLATFORM% to CMake -A.
platform:
- x64
environment:
# The (encrypted) user and password for the PyPI account
PYPIUSER:
secure: 1Hn7JfM/388aPRdxSThkkQ==
PYPIPASSWORD:
secure: 1sOoohMQBYezWsPx41QsuDkQrW+8gUuY9fh9J6BFrsI=
# - Set VS version and configuration
# - Add Qt path
# - Add Python3 path
# - on Debug exclude tests which would take too much time
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Release
QTDIR: "C:\\Qt\\5.10.1\\msvc2017_64"
PYTHON: "C:\\Python36-x64"
EXCLUDETESTS:
PYPI: true
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Debug
QTDIR: "C:\\Qt\\5.10.1\\msvc2017_64"
PYTHON: "C:\\Python36-x64"
EXCLUDETESTS: solver
PYPI:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
QTDIR: "C:\\Qt\\5.10.1\\msvc2015_64"
PYTHON: "C:\\Python36-x64"
EXCLUDETESTS:
PYPI:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Debug
QTDIR: "C:\\Qt\\5.10.1\\msvc2015_64"
PYTHON: "C:\\Python36-x64"
EXCLUDETESTS: solver
PYPI:
# Build and test with pinning and defects
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Release
QTDIR: "C:\\Qt\\5.10.1\\msvc2017_64"
PYTHON: "C:\\Python36-x64"
CMAKE_OPTIONS: "-DSPIRIT_UI_CXX_USE_QT=OFF -DSPIRIT_ENABLE_PINNING=ON -DSPIRIT_ENABLE_DEFECTS=ON"
EXCLUDETESTS:
PYPI:
install:
# Log out the python version just so we know it
- ECHO "%PYTHON_VERSION%"
# update path to use installed pip
- set PATH=%PYTHON%\\scripts;%PATH%
# Install numpy wheel and twine
- "%PYTHON%/Scripts/pip.exe install numpy wheel twine"
# Cmake will autodetect the compiler, but we set the arch
before_build:
- set PATH=%QTDIR%\bin;%PYTHON%;%PATH%
- set CXXFLAGS=%additional_flags%
- cmake -H. -BBuild -A%PLATFORM% -DUSER_PATH_QT=%QTDIR% %CMAKE_OPTIONS%
# Build with MSBuild
build:
project: Build\spirit.sln # path to Visual Studio solution or project
parallel: true # enable MSBuild parallel builds
verbosity: normal # MSBuild verbosity level {quiet|minimal|normal|detailed}
# Run unit tests with CTest
test_script:
- cd Build
- ctest --output-on-failure -C %CONFIGURATION% -E %EXCLUDETESTS%
- cd ..
# Deployment:
after_test:
# Build source distro and wheel
- echo Going to build python package and wheel
- ps: if ("$Env:APPVEYOR_REPO_BRANCH" -eq "master") {$env:SPIRIT_ADD_VERSION_SUFFIX="false"} else {$env:SPIRIT_ADD_VERSION_SUFFIX="true"}
- ps: echo "Add suffix to spirit version tag for python package $env:SPIRIT_ADD_VERSION_SUFFIX"
- cd core/python
- "%PYTHON%/python setup.py sdist bdist_wheel"
# Specify account details for PyPI
- echo [distutils] > %USERPROFILE%\\.pypirc
- echo index-servers = >> %USERPROFILE%\\.pypirc
- echo pypi >> %USERPROFILE%\\.pypirc
- echo testpypi >> %USERPROFILE%\\.pypirc
- echo [pypi] >> %USERPROFILE%\\.pypirc
- echo repository=https://upload.pypi.org/legacy/ >> %USERPROFILE%\\.pypirc
- echo username=%PYPIUSER% >> %USERPROFILE%\\.pypirc
- echo password=%PYPIPASSWORD% >> %USERPROFILE%\\.pypirc
- echo [testpypi] >> %USERPROFILE%\\.pypirc
- echo repository=https://test.pypi.org/legacy/ >> %USERPROFILE%\\.pypirc
- echo username=%PYPIUSER% >> %USERPROFILE%\\.pypirc
- echo password=%PYPIPASSWORD% >> %USERPROFILE%\\.pypirc
# Workaround required to ensure setup.py finds the .pypirc under Windows
- set HOME=%USERPROFILE%
# Publish python package
- ps: echo "PYPI deployment:"
- ps: if ("$Env:PYPI" -ne "true") {echo "Not going to deploy because not configured to."}
# Do not build pull requests
- ps: if (Test-Path env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) {echo "Not going to deploy because pull request."}
- ps: if (Test-Path env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) {$env:PYPI="false"}
# Upload to pypi on master commits (if PYPI == true)
- ps: if (("$Env:PYPI" -eq "true") -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master")) {echo "Deploying to pypi because on master branch."} else {echo "Not deploying to pypi."}
- ps: if (("$Env:PYPI" -eq "true") -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master")) {Invoke-Expression "twine upload -r pypi --skip-existing dist/*"}
# Upload to testpypi on all commits (if PYPI == true)
- ps: if (("$Env:PYPI" -eq "true")) {echo "Deploying to testpypi."} else {echo "Not deploying to testpypi."}
- ps: if (("$Env:PYPI" -eq "true")) {Invoke-Expression "twine upload -r testpypi --skip-existing dist/*"}
artifacts:
- path: core\python\dist\*