forked from phalcon/cphalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
172 lines (154 loc) · 7.32 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: 3.2.4-{build}
# to disable automatic builds
build: off
#---------------------------------#
# environment configuration #
#---------------------------------#
# environment variables
environment:
matrix:
- PHP_TARGET: 5.6
PHP_VC: 11
PHP_MAJOR: 5
PHP_SDK: c:\projects\php-sdk
PHP_DEVPACK: c:\projects\php-devpack
# clone entire repository history if not defined
clone_depth: 1
# clone directory
clone_folder: c:\projects\phalcon
# scripts that are called at very beginning, before repo cloning
init:
- SET ANSICON=121x90 (121x90)
- SET COMPOSER_NO_INTERACTION=1
- SET PARSER_VERSION=1.1.0
- SET PARSER_RELEASE=261
# build cache to preserve files/folders between builds
cache:
- vendor -> composer.json
- composer.phar -> composer.json
matrix:
# immediately finish build once one of the jobs fails
fast_finish: true
# Operating system (build VM template)
os: Windows Server 2012 R2
#---------------------------------#
# build configuration #
#---------------------------------#
# build platform, i.e. x86, x64, AnyCPU
platform:
- x86
# scripts that run after cloning repository
install:
# ==================================================
- echo Setting PHP version...
# ==================================================
- appveyor DownloadFile http://windows.php.net/downloads/releases/sha1sum.txt
- ps: |
$versions = type sha1sum.txt | where { $_ -match "php-(${env:PHP_TARGET}\.\d+)-src" } | foreach { $matches[1] }
$version = $versions.Split(' ')[-1]
$env:PHP_VERSION=${version}
- ps: $env:PARSER_DOWNLOAD_URL="https://github.com/phalcon/php-zephir-parser/releases/download/v${env:PARSER_VERSION}/zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}_${env:PARSER_VERSION}-${env:PARSER_RELEASE}.zip"
# ==================================================
- echo Initializing Build...
# ==================================================
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update --init --recursive
# ==================================================
- echo Downloading PHP source code [http://windows.php.net/downloads/releases/php-%PHP_VERSION%-Win32-VC%PHP_VC%-%PLATFORM%.zip]
# ==================================================
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-' + ${env:PHP_VERSION} + '-Win32-VC' + ${env:PHP_VC} + '-' + ${env:PLATFORM} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php.zip')
- cd ..
- 'mkdir php && mv php.zip php\php.zip && cd php'
- 7z.exe x php.zip | FIND /V "ing "
- cd ..
- echo Downloading PHP-SDK
- mkdir php-sdk && cd php-sdk
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php-sdk.zip')
- '7z.exe x ..\php-sdk.zip | FIND /V "ing "'
- cd ..
# ==================================================
- echo Install PHP Dev pack
# ==================================================
- ps: >-
If ($env:PHP_TYPE -Match "nts-Win32") {
$env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-nts-Win32-VC${env:PHP_VC}-${env:PLATFORM}"
} Else {
$env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-Win32-VC${env:PHP_VC}-${env:PLATFORM}"
}
# ==================================================
- echo Downloading PHP Dev pack source code [http://windows.php.net/downloads/releases/php-devel-pack-%DEVEL_PACK_VERSION%.zip]
# ==================================================
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:DEVEL_PACK_VERSION} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php-dev.zip')
- 7z.exe x php-dev.zip | FIND /V "ing "
- mv php-%PHP_VERSION%-devel-VC11-%PLATFORM% php-devpack
# ==================================================
- echo Enable Zephir Parser
# ==================================================
- 'cd %APPVEYOR_BUILD_FOLDER%\..\php\ext'
- curl --location --silent --show-error %PARSER_DOWNLOAD_URL% --output zephir_parser.zip
- 7z.exe x zephir_parser.zip | FIND /V "ing "
# ==================================================
- echo Building PHP [%PHP_VERSION%]
# ==================================================
- '%PHP_SDK%\bin\phpsdk_setvars'
- 'cd %APPVEYOR_BUILD_FOLDER%\..\php'
- '"%VS110COMNTOOLS%\VsDevCmd" %PLATFORM%'
- 'echo extension_dir=%APPVEYOR_BUILD_FOLDER%\..\php\ext > php.ini'
- 'echo extension=php_zephir_parser.dll >> php.ini'
- 'echo extension=php_curl.dll >> php.ini'
- 'echo extension=php_openssl.dll >> php.ini'
- 'echo extension=php_mbstring.dll >> php.ini'
- 'echo extension=php_pdo_sqlite.dll >> php.ini'
- 'echo extension=php_fileinfo.dll >> php.ini'
- 'echo extension=php_gettext.dll >> php.ini'
- 'echo extension=php_gd2.dll >> php.ini'
- 'echo extension=c:\php_imagick\php_imagick.dll >> php.ini'
- 'echo memory_limit=256M >> php.ini'
- 'set PATH=%cd%;%PATH%;c:\ImageMagick\bin;c:\php_imagick'
- php --ri "Zephir Parser"
# ==================================================
- echo Setting up the php_imagick
# ==================================================
- mkdir c:\ImageMagick && cd c:\ImageMagick
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/pecl/deps/ImageMagick-6.9.3-7-vc11-x86.zip', 'c:\ImageMagick\ImageMagick.zip')
- 7z.exe x ImageMagick.zip | FIND /V "ing "
- mkdir c:\php_imagick && cd c:\php_imagick
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/pecl/releases/imagick/3.4.3rc1/php_imagick-3.4.3rc1-5.6-ts-vc11-x86.zip', 'c:\php_imagick\php_imagick.zip')
- 7z.exe x php_imagick.zip | FIND /V "ing "
# ==================================================
- echo Download tests dependencies...
# ==================================================
- cd %APPVEYOR_BUILD_FOLDER%
- if not exist vendor (php -r "readfile('https://getcomposer.org/installer');" | php && php composer.phar --version)
- if not exist vendor (php composer.phar update --quiet --no-ansi --no-interaction --no-progress --optimize-autoloader --dev --prefer-dist --no-suggest --ignore-platform-reqs)
# ==================================================
- echo Download Zephir
# ==================================================
- cd %APPVEYOR_BUILD_FOLDER%
- 'vendor\bin\zephir help'
build_script:
- 'vendor\bin\zephir generate -Wnonexistent-function -Wnonexistent-class -Wunused-variable'
- 'php build\gen-build.php'
- 'cd build\php%PHP_MAJOR%\safe'
- '%PHP_DEVPACK%\\phpize'
- configure --enable-phalcon
- nmake
on_finish:
- cd %APPVEYOR_BUILD_FOLDER%
- ps: Push-AppveyorArtifact build\php${env:PHP_MAJOR}\safe\Release_TS\php_phalcon.dll
on_failure :
- 'dir'
- ps: >-
IF (Test-Path -Path compile-errors.log) {
type compile-errors.log
}
IF (Test-Path -Path compile.log) {
type compile.log
}
IF (Test-Path -Path configure.js) {
type configure.js
}