-
Notifications
You must be signed in to change notification settings - Fork 15
/
.appveyor.yml
130 lines (112 loc) · 4.26 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
#---------------------------------#
# general configuration #
#---------------------------------#
version: 3.3.1-{build}-{branch}
branches:
only:
- develop
- master
image: Visual Studio 2019
environment:
CONDA: c:\Miniconda37-x64
ECMWF: c:\ecmwf
GIT_CLONE_DIR: $(ECMWF)\git
INSTALL_DIR: $(ECMWF)\install
MAGICS_SRC: $(GIT_CLONE_DIR)\magics
MAGICS_TESTS_SRC: ${MAGICS_SRC}/../magics-test
MAGICS_PYTHON_TESTS: $(MAGICS_TESTS_SRC)\test\gallery
MAGPLUS_HOME: $(INSTALL_DIR)
MAGICS_PYTHON_SRC: $(GIT_CLONE_DIR)\magics_python
ECBUILD_SRC: $(GIT_CLONE_DIR)\ecbuild
# scripts that are called at very beginning, before repo cloning
init:
# activate MSVC environment - https://www.appveyor.com/docs/lang/cpp/
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
# activate conda environment so we use the correct version of python during the build
- cmd: call %CONDA%\Scripts\activate.bat
# make sure git clones symlinks as symlinks
- cmd: git config --global core.symlinks true
# add conda bins to path so tests can find linux utils
- cmd: set PATH=%CONDA%\Library\usr\bin;%CONDA%\Library\bin;%CONDA%\Scripts;%CONDA%\bin;%PATH%
# add magics\build\bin to path so tests can find magics.dll
- cmd: set PATH=%PATH%;%MAGICS_SRC%\build\bin
# add install_dir to path so tests can find eccodes.dll
- cmd: set PATH=%PATH%;%INSTALL_DIR%
# auto-yes for conda
- cmd: conda config --set always_yes yes
# update conda
- cmd: conda update -n base -c conda-forge conda
clone_folder: $(MAGICS_SRC)
clone_depth: 1
# scripts that run after cloning repository
install:
# install ecbuild
- cmd: git clone --depth 1 https://github.com/ecmwf/ecbuild.git %ECBUILD_SRC% -b %APPVEYOR_REPO_BRANCH%
# install magics-python src
- cmd: git clone -b master --depth 1 https://github.com/ecmwf/magics-python.git %MAGICS_PYTHON_SRC%
- cmd: git clone --depth 1 https://github.com/ecmwf/magics-test.git %MAGICS_TESTS_SRC%
# install linux utils
- cmd: conda install -c msys2 m2-bash ^
m2-findutils ^
m2-coreutils ^
m2-grep ^
m2-sed ^
m2-gawk ^
m2-diffutils ^
m2-perl ^
m2-unzip
# install conda deps
- cmd: conda install -c conda-forge libnetcdf expat xarray scipy cftime
- cmd: conda install -c conda-forge cmake jom proj4=6 pthreads-win32 libiconv eccodes pytest
- cmd: pip install findlibs
# gtk+ - needed for pango
# includes cairo, pango, glib, and other deps
- cmd: cd %ECMWF%
- cmd: curl -O -L http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
- cmd: unzip gtk+-bundle_2.22.1-20101229_win64.zip -d gtk
- cmd: rm gtk+-bundle_2.22.1-20101229_win64.zip
- cmd: set GTK=%ECMWF%\gtk
- cmd: set PATH=%PATH%;%GTK%\bin;%GTK%\lib
#---------------------------------#
# build configuration #
#---------------------------------#
platform:
- x64
before_build:
# add include paths
- cmd: set INCLUDE=%INCLUDE%;%GTK%\include
- cmd: set INCLUDE=%INCLUDE%;%GTK%\include\cairo
- cmd: set INCLUDE=%INCLUDE%;%GTK%\include\glib-2.0;%GTK%\lib\glib-2.0\include
# check we got all the dlls
# gtk
- cmd: where libpango-1.0-0.dll
- cmd: where libglib-2.0-0.dll
- cmd: where libcairo-2.dll
- cmd: where libfontconfig-1.dll
- cmd: where libfreetype-6.dll
- cmd: where libpng14-14.dll
- cmd: where libintl-8.dll
# eccodes
- cmd: where eccodes.dll
# conda
- cmd: where pthreadvse2.dll
- cmd: where netcdf.dll
- cmd: where vcruntime140.dll
build_script:
- cmd: cd %MAGICS_SRC%
- cmd: mkdir build && cd build
- cmd: cmake -G "NMake Makefiles JOM" ^
-D CMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
-D CMAKE_BUILD_TYPE=Release ^
-D GTK_PATH=%GTK%
..
- cmd: jom -j2
- cmd: ctest --output-on-failure
- cmd: jom install
#---------------------------------#
# tests configuration #
#---------------------------------#
test_script:
- cmd: cd %MAGICS_PYTHON_SRC%
- cmd: set PYTHONPATH=%PYTHONPATH%;%MAGICS_PYTHON_SRC%
- cmd: pytest