-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path.appveyor.yml
109 lines (94 loc) · 3.73 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
environment:
global:
# 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 .\tools\appveyor\run_with_env.cmd'
ANACONDA_TOKEN:
secure: hkjyENhlvGf1C+qeTYgkU+ggPCmHAdAh8FCGJpdnEw8kmUJlqqDXfRWt94qE6W3Y
PYPKG: yaff
GITHUB_REPO_NAME: molmod/yaff
matrix:
# It is not possible to compile the Yaff extension on Windows for Python 2.7 because
# Python 2.7 on Windows is built with an old visual compiler, which does not even support
# C99! The C99 standard is extensively used in the Yaff extension.
# - PYTHON_VERSION: 2.7
# CONDA: C:\Miniconda
- PYTHON_VERSION: 3.6
CONDA: C:\Miniconda36
version: '{build}'
image: Visual Studio 2015
platform:
- x86
- x64
branches:
only:
- master
init:
- ps: if ($Env:PLATFORM -eq "x64") { $Env:CONDA = "${Env:CONDA}-x64" }
- ps: Write-Host $Env:PYTHON_VERSION
- ps: Write-Host $Env:CONDA
- ps: Write-Host $Env:GITHUB_REPO_NAME
- ps: Write-Host $Env:PLATFORM
- ps: Write-Host $Env:APPVEYOR_REPO_TAG
- ps: Write-Host $Env:APPVEYOR_REPO_TAG_NAME
- ps: Write-Host $Env:APPVEYOR_REPO_NAME
install:
# Load the conda root environment, configure and install some packages
- '"%CONDA%\Scripts\activate.bat"'
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels molmod
- conda update -q conda
- conda install conda-build anaconda-client numpy cython
# Install codecov tool for uploading coverage reports
- pip install codecov coverage
# Can't install LAMMPS, no channel with LAMMPS library available for Windows
# - conda install -c pyiron lammps
# Show conda info for debugging
- conda info -a
build: false
test_script:
# Build the package
- git fetch origin --tags
- "%CMD_IN_ENV% conda build tools/conda.recipe"
# Install the package
- conda install --use-local %PYPKG%
# No visual backend for matplotlib
- 'mkdir "%HOME%\.matplotlib\"'
- 'echo "backend:agg" > "%HOME%\.matplotlib\matplotlibrc"'
# Run the tests outside the source tree.
- pushd "%HOMEPATH%" && (nosetests %PYPKG% -v --detailed-errors --with-coverage
--cover-package=%PYPKG% --cover-tests --cover-erase --cover-inclusive
--cover-branches --cover-xml & popd)
after_test:
# Copy the conda build to the home dir, such that it can be registerd as an artifact
- move %CONDA%\conda-bld .
# Upload coverage reports
- 'codecov -f "%HOMEPATH%\coverage.xml"'
artifacts:
# Files to be uploaded
- path: 'conda-bld\win-*\*.tar.bz2'
on_success:
# Upload to anaconda, with the correct label derived from the version tag.
# This is virtually impossible with a normal dos batch script...
# It also contains an incredibly clunky way to avoid build failure when anaconda writes
# something harmless to stderr. The normal way does not work!
# & anaconda $parameters 2>&1
# Powershell should be called Powerhell!
- ps:
if (($Env:APPVEYOR_REPO_TAG -eq "true") -and
($Env:APPVEYOR_REPO_NAME -eq ${Env:GITHUB_REPO_NAME})) {
$tar_glob = ".\conda-bld\win-*\${Env:PYPKG}-${Env:APPVEYOR_REPO_TAG_NAME}-*.tar.bz2";
Write-Host "tar_glob $tar_glob";
if ($Env:APPVEYOR_REPO_TAG_NAME -like "*a*") {
$anaconda_label = "alpha"
} elseif ($Env:APPVEYOR_REPO_TAG_NAME -like "*b*") {
$anaconda_label = "beta"
} else {
$anaconda_label = "main"
};
Write-Host "anaconda_label $anaconda_label";
$parameters = '-t', "$Env:ANACONDA_TOKEN", 'upload', "$tar_glob", '-l',
"$anaconda_label", '--force', '--no-progress';
& cmd /c 'anaconda 2>&1' $parameters;
}