]> git.mxchange.org Git - friendica.git/blob - .drone.yml
Use HTTPRequestOptions constants for HTTPClient::get()
[friendica.git] / .drone.yml
1 kind: pipeline
2 type: docker
3 name: Check messages.po
4
5 steps:
6   - name: Run default Xgettext
7     image: friendicaci/transifex
8     commands:
9       - ./bin/run_xgettext.sh
10
11   - name: Check default
12     image: friendicaci/transifex
13     commands:
14       - /check-messages.sh
15 ---
16 kind: pipeline
17 type: docker
18 name: php7.3-lint
19
20 steps:
21   - name: Test
22     image: php:7.3
23     commands:
24       - ./bin/composer.phar run lint
25 ---
26 kind: pipeline
27 type: docker
28 name: php7.4-lint
29
30 steps:
31   - name: Test
32     image: php:7.4
33     commands:
34       - ./bin/composer.phar run lint
35 ---
36 kind: pipeline
37 type: docker
38 name: php8.0-lint
39
40 steps:
41   - name: Test
42     image: php:8.0
43     commands:
44       - ./bin/composer.phar run lint
45 ---
46 kind: pipeline
47 type: docker
48 name: php-cs check
49
50 trigger:
51   event:
52     - pull_request
53
54 steps:
55   - name: Restore cache
56     image: meltwater/drone-cache:dev
57     settings:
58       backend: "filesystem"
59       restore: true
60       cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}'
61       archive_format: "gzip"
62       mount:
63         - '.composer'
64     volumes:
65       - name: cache
66         path: /tmp/cache
67   - name: Install dependencies
68     image: composer
69     commands:
70       - export COMPOSER_HOME=.composer
71       - ./bin/composer.phar run cs:install
72   - name: Rebuild cache
73     image: meltwater/drone-cache:dev
74     settings:
75       backend: "filesystem"
76       rebuild: true
77       cache_key: '{{ .Repo.Name }}_phpcs_{{ arch }}_{{ os }}'
78       archive_format: "gzip"
79       mount:
80         - '.composer'
81     volumes:
82       - name: cache
83         path: /tmp/cache
84   - name: Run coding standards check
85     image: friendicaci/php-cs
86     commands:
87       - export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2)"
88       - /check-php-cs.sh
89
90 volumes:
91   - name: cache
92     host:
93       path: /tmp/drone-cache
94 ---
95 kind: pipeline
96 type: docker
97 name: php7.3-mariadb
98
99 steps:
100   - name: Restore cache
101     image: meltwater/drone-cache:dev
102     settings:
103       backend: "filesystem"
104       restore: true
105       cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
106       archive_format: "gzip"
107       mount:
108         - '.composer'
109     volumes:
110       - name: cache
111         path: /tmp/cache
112   - name: Composer install
113     image: friendicaci/php7.3:php7.3.28
114     commands:
115       - export COMPOSER_HOME=.composer
116       - ./bin/composer.phar validate
117       - ./bin/composer.phar install --prefer-dist
118   - name: Rebuild cache
119     image: meltwater/drone-cache:dev
120     settings:
121       backend: "filesystem"
122       rebuild: true
123       cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
124       archive_format: "gzip"
125       mount:
126         - '.composer'
127     volumes:
128       - name: cache
129         path: /tmp/cache
130   - name: Test Friendica
131     image: friendicaci/php7.3:php7.3.28
132     environment:
133       MYSQL_HOST: "mariadb"
134       MYSQL_PORT: 3306
135       MYSQL_DATABASE: "test"
136       MYSQL_PASSWORD: "test"
137       MYSQL_USER: "test"
138       REDIS_HOST: "redis"
139       MEMCACHED_HOST: "memcached"
140       MEMCACHE_HOST: "memcached"
141     commands:
142       - cp config/local-sample.config.php config/local.config.php
143       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
144       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
145       - phpunit --configuration tests/phpunit.xml
146
147 services:
148   - name: mariadb
149     image: mariadb:latest
150     environment:
151       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
152       MYSQL_DATABASE: "test"
153       MYSQL_PASSWORD: "test"
154       MYSQL_USER: "test"
155     tmpfs:
156       - /var/lib/mysql
157
158   - name: memcached
159     image: memcached
160
161   - name: redis
162     image: redis
163
164 volumes:
165   - name: cache
166     host:
167       path: /tmp/drone-cache
168 ---
169 kind: pipeline
170 type: docker
171 name: php7.4-mariadb
172
173 steps:
174   - name: Restore cache
175     image: meltwater/drone-cache:dev
176     settings:
177       backend: "filesystem"
178       restore: true
179       cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
180       archive_format: "gzip"
181       mount:
182         - '.composer'
183     volumes:
184       - name: cache
185         path: /tmp/cache
186   - name: Composer install
187     image: friendicaci/php7.4:php7.4.18
188     commands:
189       - export COMPOSER_HOME=.composer
190       - ./bin/composer.phar validate
191       - ./bin/composer.phar install --prefer-dist
192   - name: Rebuild cache
193     image: meltwater/drone-cache:dev
194     settings:
195       backend: "filesystem"
196       rebuild: true
197       cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
198       archive_format: "gzip"
199       mount:
200         - '.composer'
201     volumes:
202       - name: cache
203         path: /tmp/cache
204   - name: Test Friendica
205     image: friendicaci/php7.4:php7.4.18
206     environment:
207       MYSQL_HOST: "mariadb"
208       MYSQL_PORT: 3306
209       MYSQL_DATABASE: "test"
210       MYSQL_PASSWORD: "test"
211       MYSQL_USER: "test"
212       REDIS_HOST: "redis"
213       MEMCACHED_HOST: "memcached"
214       MEMCACHE_HOST: "memcached"
215       XDEBUG_MODE: "coverage"
216     commands:
217       - phpenmod xdebug
218       - cp config/local-sample.config.php config/local.config.php
219       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
220       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
221       - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
222   - name: Codecov
223     image: plugins/codecov
224     when:
225       repo:
226         - friendica/friendica
227     settings:
228       token:
229         from_secret: codecov-token
230       files:
231         - clover.xml
232
233 services:
234   - name: mariadb
235     image: mariadb:latest
236     environment:
237       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
238       MYSQL_DATABASE: "test"
239       MYSQL_PASSWORD: "test"
240       MYSQL_USER: "test"
241     tmpfs:
242       - /var/lib/mysql
243
244   - name: memcached
245     image: memcached
246
247   - name: redis
248     image: redis
249
250 volumes:
251   - name: cache
252     host:
253       path: /tmp/drone-cache
254 ---
255 kind: pipeline
256 type: docker
257 name: php8.0-mariadb
258
259 steps:
260   - name: Restore cache
261     image: meltwater/drone-cache:dev
262     settings:
263       backend: "filesystem"
264       restore: true
265       cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
266       archive_format: "gzip"
267       mount:
268         - '.composer'
269     volumes:
270       - name: cache
271         path: /tmp/cache
272   - name: Composer install
273     image: friendicaci/php8.0:php8.0.5
274     commands:
275       - export COMPOSER_HOME=.composer
276       - ./bin/composer.phar validate
277       - ./bin/composer.phar install --prefer-dist
278   - name: Rebuild cache
279     image: meltwater/drone-cache:dev
280     settings:
281       backend: "filesystem"
282       rebuild: true
283       cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
284       archive_format: "gzip"
285       mount:
286         - '.composer'
287     volumes:
288       - name: cache
289         path: /tmp/cache
290   - name: Test Friendica
291     image: friendicaci/php8.0:php8.0.5
292     environment:
293       MYSQL_HOST: "mariadb"
294       MYSQL_PORT: 3306
295       MYSQL_DATABASE: "test"
296       MYSQL_PASSWORD: "test"
297       MYSQL_USER: "test"
298       REDIS_HOST: "redis"
299       MEMCACHED_HOST: "memcached"
300       MEMCACHE_HOST: "memcached"
301     commands:
302       - cp config/local-sample.config.php config/local.config.php
303       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
304       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
305       - phpunit --configuration tests/phpunit.xml
306
307 services:
308   - name: mariadb
309     image: mariadb:latest
310     environment:
311       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
312       MYSQL_DATABASE: "test"
313       MYSQL_PASSWORD: "test"
314       MYSQL_USER: "test"
315     tmpfs:
316       - /var/lib/mysql
317
318   - name: memcached
319     image: memcached
320
321   - name: redis
322     image: redis
323
324 volumes:
325   - name: cache
326     host:
327       path: /tmp/drone-cache