forked from weprovide/valet-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
215 lines (166 loc) · 5.48 KB
/
azure-pipelines.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
trigger:
- master
- 2.x
# Build on Catalina and Mojave
strategy:
matrix:
catalina:
imageName: 'macOS-10.15'
mojave:
imageName: 'macOS-10.14'
pool:
vmImage: $(imageName)
# All actions starting with [INSTALL] are installation instructions that can be found
# in the Valet+ installation wiki page: https://github.com/weprovide/valet-plus/wiki/Installation
steps:
# Valet install command test cases
- script: |
brew update
displayName: '[INSTALL] Brew update'
# For the Valet+ CI/CD remove the default brew PHP. Instead use valet-php.
# On a local installation one might choose to keep his/her default brew PHP installation.
- script: |
brew uninstall php
displayName: '[INSTALL] Brew uninstall php'
# Install the valet-php brew tap.
- script: |
brew tap henkrehorst/php
displayName: '[INSTALL] Brew tap henkrehost/php'
# Install the default PHP version (currently: [email protected]).
- script: |
brew install [email protected]
displayName: '[INSTALL] Brew install [email protected]'
# Link [email protected] as default php binary.
- script: |
brew link [email protected] --force
php -v | grep 7.2
displayName: '[INSTALL] Brew link [email protected]'
# Since the azure CI/CD image comes with composer pre-installed there is no need to install composer.
# However the image might change in the future. To ensure installation over several images an IF ELSE used.
# If installed print "Composer is already installed!" else install composer from brew.
# This way even if the image changes the installation instruction would be checked.
- script: |
if which composer | grep -q composer; then echo Composer is already installed!; else brew install composer; fi
displayName: '[INSTALL] Brew install composer'
- script: |
composer install
displayName: '[INSTALL] Composer install'
# If the code style does not pass there is no need to run other tests.
- script: |
./vendor/squizlabs/php_codesniffer/bin/phpcs
displayName: '[CODE STYLE] Check PSR-2'
# Somewhere around this point the Valet+ binary needs to be referenced in your PATH.
# Since the CI/CD targeting the binary directly the CI/CD does not check this.
- script: |
./valet fix
displayName: '[INSTALL] Valet fix'
- script: |
./valet install
displayName: '[INSTALL] Valet install'
# PHP 5.6 Command test cases
- script: |
./valet use 5.6
displayName: '[PHP 5.6] Switch to'
- script: |
php -v | grep 5.6
displayName: '[PHP 5.6] Check version'
- script: |
./valet xdebug on
./valet xdebug off
displayName: '[PHP 5.6] xdebug on and off'
- script: |
./valet ioncube on
./valet ioncube off
displayName: '[PHP 5.6] ioncube on and off'
# PHP 7.0 Command test cases
- script: |
./valet use 7.0
displayName: '[PHP 7.0] Switch to'
- script: |
php -v | grep 7.0
displayName: '[PHP 7.0] Check version'
- script: |
./valet xdebug on
./valet xdebug off
displayName: '[PHP 7.0] xdebug on and off'
- script: |
./valet ioncube on
./valet ioncube off
displayName: '[PHP 7.0] ioncube on and off'
# PHP 7.1 Command test cases
- script: |
./valet use 7.1
displayName: '[PHP 7.1] Switch to'
- script: |
php -v | grep 7.1
displayName: '[PHP 7.1] Check version'
- script: |
./valet xdebug on
./valet xdebug off
displayName: '[PHP 7.1] xdebug on and off'
- script: |
./valet ioncube on
./valet ioncube off
displayName: '[PHP 7.1] ioncube on and off'
# PHP 7.2 Command test cases
- script: |
./valet use 7.2
displayName: '[PHP 7.2] Switch to'
- script: |
php -v | grep 7.2
displayName: '[PHP 7.2] Check version'
- script: |
./valet xdebug on
./valet xdebug off
displayName: '[PHP 7.2] xdebug on and off'
- script: |
./valet ioncube on
./valet ioncube off
displayName: '[PHP 7.2] ioncube on and off'
# PHP 7.3 Command test cases
- script: |
./valet use 7.3
displayName: '[PHP 7.3] Switch to'
- script: |
php -v | grep 7.3
displayName: '[PHP 7.3] Check version'
- script: |
./valet xdebug on
./valet xdebug off
displayName: '[PHP 7.3] xdebug on and off'
- script: |
./valet ioncube on
./valet ioncube off
displayName: '[PHP 7.3] ioncube on and off'
# PHP 7.4 Command test cases
- script: |
./valet use 7.4
displayName: '[PHP 7.4] Switch to'
- script: |
php -v | grep 7.4
displayName: '[PHP 7.4] Check version'
- script: |
./valet xdebug on
./valet xdebug off
displayName: '[PHP 7.4] xdebug on and off'
- script: |
./valet ioncube on
./valet ioncube off
displayName: '[PHP 7.4] ioncube on and off'
# Test Memcached
- script: |
brew reinstall pkg-config
./valet memcache install
displayName: '[MEMCACHED] install'
- script: |
./valet memcache uninstall
displayName: '[MEMCACHED] uninstall'
# Extensions of commonly run commands, generally not hit or checked by the installation instructions.
# Chown the default PHP version to ensure deletion is possible.
# If we don't chown we'll get an permission error from the CI/CD.
# On local installations the printed instructions can be followed
# to manually remove the Cellar files.
- script: |
sudo chmod -R 777 /usr/local/Cellar/[email protected]
./valet fix --reinstall
displayName: '[INSTALL] Valet fix --reinstall'