forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappveyor.yml
More file actions
126 lines (108 loc) · 5.32 KB
/
appveyor.yml
File metadata and controls
126 lines (108 loc) · 5.32 KB
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
shallow_clone: true
environment:
global:
TEST_DEPS: "nose wheel pip"
NSIS_DIR: "%PROGRAMFILES(x86)%/NSIS"
matrix:
# Pre-installed Python versions, which Appveyor may upgrade to
# a later point release.
- PYTHON: "C:\\Miniconda35"
PYTHON_VERSION: "3.5.x"
PYTHON_MAJOR: 3
PYTHON_ARCH: "32"
CONDA_PY: "35"
CONDA_NPY: "19"
WP_URL: 'https://github.com/winpython/winpython/releases/download/1.3.20160209/WinPython-32bit-3.5.1.2.exe'
WP_CRC: '172d19a743ccfaf55af779d15f29f67fca83a46f08b0af855dfaf809b4184c0d'
DEPS: "numpy scipy matplotlib ipython h5py sympy scikit-learn dill mock setuptools natsort"
- PYTHON: "C:\\Miniconda35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_MAJOR: 3
PYTHON_ARCH: "64"
CONDA_PY: "35"
CONDA_NPY: "19"
WP_URL: 'https://github.com/winpython/winpython/releases/download/1.3.20160209/WinPython-64bit-3.5.1.2.exe'
WP_CRC: '07e854b9aa7a31d8bbf7829d04a45b6d6266603690520e365199af2d98751ab1'
DEPS: "numpy scipy matplotlib ipython h5py sympy scikit-learn dill mock setuptools natsort"
init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
- "ECHO %APPVEYOR_BUILD_FOLDER%"
- "ECHO %CMD_IN_ENV%"
install:
- ps: Add-AppveyorMessage "Starting install..."
# Prepend Python to the PATH
- "SET ORIGPATH=%PATH%"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Install the dependencies of the project.
- ps: Add-AppveyorMessage "Installing conda packages..."
- "%CMD_IN_ENV% conda install -yq %TEST_DEPS%"
- "%CMD_IN_ENV% conda install -yq %DEPS%"
# Having 'sip' folder on path confuses import of `sip`.
- "%CMD_IN_ENV% move %PYTHON%\\sip %PYTHON%\\Lib\\site-packages\\PyQt4\\sip"
- "%CMD_IN_ENV% conda install pip"
# TODO: Remove once anaconda taitsui package is at v5:
- "IF \"%PYTHON_MAJOR%\" EQU \"3\" pip install --upgrade traitsui"
- ps: Add-AppveyorMessage "Installing hyperspy..."
- "python setup.py install"
build: false # Not a C# project, build stuff at the test step instead.
test_script:
# Run the project tests
- ps: Add-AppveyorMessage "Running tests..."
- "python continuous_integration/nosetest.py hyperspy"
- ps: Add-AppveyorMessage "Testing completed."
# Auto-deployment of bundle installer for tags:
before_deploy:
- ps: Add-AppveyorMessage "Running deployment step..."
- "pip install winpython"
- "pip install https://github.com/hyperspy/hyperspy-bundle/archive/master.zip"
# Download WinPython installer if not cached
- ps: Add-AppveyorMessage "Installing WinPython..."
- "SET WP_INSTDIR=%APPDATA%\\wpdir\\WinPython-%PYTHON_ARCH%bit\\"
- "SET WP_EXE=%APPDATA%/wpdir/WinPython%PYTHON_MAJOR%-%PYTHON_ARCH%bit.exe"
- "mkdir %APPDATA%\\wpdir"
- ps: appveyor DownloadFile $Env:WP_URL -FileName $Env:WP_EXE
- ps: Write-Output (Get-FileHash $Env:WP_EXE)
- ps: if ((Get-FileHash $Env:WP_EXE).Hash -ne $Env:WP_CRC) { exit(1) }
- ps: (& $Env:WP_EXE /S /D=$Env:WP_INSTDIR | Out-Null )
- "ls %APPDATA%/wpdir"
- "ls %WP_INSTDIR%"
# Patch NSIS to allow longer strings
- ps: Add-AppveyorMessage "Setting up WinPython environment..."
- ps: Start-FileDownload ('http://freefr.dl.sourceforge.net/project/nsis/NSIS%202/2.46/nsis-2.46-strlen_8192.zip') ../nsis_patch.zip
- ps: if ((Get-FileHash '../nsis_patch.zip').Hash -ne '3BA22DDC0F14DBD75A9487EB6C9BD85F535E7038927D251103B97E0AAD94EEAD') { exit(1) }
- "7z x ../nsis_patch.zip -o%NSIS_DIR -aoa"
- ps: Start-FileDownload ('http://nsis.sourceforge.net/mediawiki/images/e/eb/Textreplace.zip') ../Textreplace.zip
- ps: if ((Get-FileHash '../Textreplace.zip').Hash -ne '6462C0C22E87E7C81DD9076D40ACC74C515243A56F10F4F8FE720F7099DB3BA2') { exit(1) }
- "7z x ../Textreplace.zip -o%NSIS_DIR% -aoa"
- ps: Start-FileDownload ('http://nsis.sourceforge.net/mediawiki/images/8/8f/UAC.zip') ../UAC.zip
- ps: if ((Get-FileHash '../UAC.zip').Hash -ne '20E3192AF5598568887C16D88DE59A52C2CE4A26E42C5FB8BEE8105DCBBD1760') { exit(1) }
- "7z x ../UAC.zip -o%NSIS_DIR% -aoa"
# Install current hyperspy in WinPython
- "SET PATH=%ORIGPATH%"
- "%CMD_IN_ENV% %WP_INSTDIR%/scripts/env.bat"
- "%CMD_IN_ENV% python.exe setup.py install"
- "%CMD_IN_ENV% pip install --upgrade configobj traitsui natsort start_jupyter_cm"
# Custom installer step
# TODO: Re-run tests in WinPython environment
- ps: Add-AppveyorMessage "Creating installer..."
- "%PYTHON%/python.exe -m hspy_bundle.configure_installer %APPDATA%/wpdir %PYTHON_ARCH% %APPVEYOR_REPO_TAG_NAME%"
- "\"%NSIS_DIR%/makensis.exe\" /V3 NSIS_installer_script-%PYTHON_ARCH%bit.nsi"
- ps: Add-AppveyorMessage "Installer created! Pushing to GitHub..."
- "appveyor PushArtifact HyperSpy-%APPVEYOR_REPO_TAG_NAME%-Bundle-Windows-%PYTHON_ARCH%bit.exe"
deploy:
release: $(APPVEYOR_REPO_TAG_NAME)
description: 'Release: $(APPVEYOR_REPO_COMMIT_MESSAGE)'
provider: GitHub
auth_token:
# to266:
secure: ptV5Dkz3pSVdjD0qRDpxJgjVlddFtleZ+B+c2X1Fg67P8OX3bHWVktRmlj6hfLhM
# vidartf:
#secure: KwAfARhGEqOnZHltPB6kKu8xmnoiGSk7NMYJBIEbWvFCuVnepoPV7ZcIjUN3pUpK
artifact: /.*\.exe/ # upload all exe installers to release assets
draft: true
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only