]> git.mxchange.org Git - friendica.git/blob - .drone.yml
Add cache for PHP 8.0 test
[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: Install dependencies
56     image: composer
57     commands:
58       - ./bin/composer.phar run cs:install
59   - name: Run coding standards check
60     image: friendicaci/php-cs
61     commands:
62       - export CHANGED_FILES="$(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | grep ^A | cut -f2)"
63       - /check-php-cs.sh
64 ---
65 kind: pipeline
66 type: docker
67 name: php7.3-mariadb
68
69 steps:
70   - name: Restore cache
71     image: meltwater/drone-cache:dev
72     settings:
73       backend: "filesystem"
74       restore: true
75       cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
76       archive_format: "gzip"
77       mount:
78         - '.composer'
79     volumes:
80       - name: cache
81         path: /tmp/cache
82   - name: Composer install
83     image: friendicaci/php7.3:php7.3.28
84     commands:
85       - export COMPOSER_HOME=.composer
86       - ./bin/composer.phar validate
87       - ./bin/composer.phar install --prefer-dist
88   - name: Rebuild cache
89     image: meltwater/drone-cache:dev
90     settings:
91       backend: "filesystem"
92       rebuild: true
93       cache_key: '{{ .Repo.Name }}_php73_{{ arch }}_{{ os }}'
94       archive_format: "gzip"
95       mount:
96         - '.composer'
97     volumes:
98       - name: cache
99         path: /tmp/cache
100   - name: Test Friendica
101     image: friendicaci/php7.3:php7.3.28
102     environment:
103       MYSQL_HOST: "mariadb"
104       MYSQL_PORT: 3306
105       MYSQL_DATABASE: "test"
106       MYSQL_PASSWORD: "test"
107       MYSQL_USER: "test"
108       REDIS_HOST: "redis"
109       MEMCACHED_HOST: "memcached"
110       MEMCACHE_HOST: "memcached"
111     commands:
112       - cp config/local-sample.config.php config/local.config.php
113       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
114       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
115       - phpunit --configuration tests/phpunit.xml
116
117 services:
118   - name: mariadb
119     image: mariadb:latest
120     environment:
121       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
122       MYSQL_DATABASE: "test"
123       MYSQL_PASSWORD: "test"
124       MYSQL_USER: "test"
125     tmpfs:
126       - /var/lib/mysql
127
128   - name: memcached
129     image: memcached
130
131   - name: redis
132     image: redis
133
134 volumes:
135   - name: cache
136     host:
137       path: /tmp/drone-cache
138 ---
139 kind: pipeline
140 type: docker
141 name: php7.4-mariadb
142
143 steps:
144   - name: Restore cache
145     image: meltwater/drone-cache:dev
146     settings:
147       backend: "filesystem"
148       restore: true
149       cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
150       archive_format: "gzip"
151       mount:
152         - '.composer'
153     volumes:
154       - name: cache
155         path: /tmp/cache
156   - name: Composer install
157     image: friendicaci/php7.4:php7.4.18
158     commands:
159       - export COMPOSER_HOME=.composer
160       - ./bin/composer.phar validate
161       - ./bin/composer.phar install --prefer-dist
162   - name: Rebuild cache
163     image: meltwater/drone-cache:dev
164     settings:
165       backend: "filesystem"
166       rebuild: true
167       cache_key: '{{ .Repo.Name }}_php74_{{ arch }}_{{ os }}'
168       archive_format: "gzip"
169       mount:
170         - '.composer'
171     volumes:
172       - name: cache
173         path: /tmp/cache
174   - name: Test Friendica
175     image: friendicaci/php7.4:php7.4.18
176     environment:
177       MYSQL_HOST: "mariadb"
178       MYSQL_PORT: 3306
179       MYSQL_DATABASE: "test"
180       MYSQL_PASSWORD: "test"
181       MYSQL_USER: "test"
182       REDIS_HOST: "redis"
183       MEMCACHED_HOST: "memcached"
184       MEMCACHE_HOST: "memcached"
185       XDEBUG_MODE: "coverage"
186     commands:
187       - phpenmod xdebug
188       - cp config/local-sample.config.php config/local.config.php
189       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
190       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
191       - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
192   - name: Codecov
193     image: plugins/codecov
194     when:
195       repo:
196         - friendica/friendica
197     settings:
198       token:
199         from_secret: codecov-token
200       files:
201         - clover.xml
202
203 services:
204   - name: mariadb
205     image: mariadb:latest
206     environment:
207       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
208       MYSQL_DATABASE: "test"
209       MYSQL_PASSWORD: "test"
210       MYSQL_USER: "test"
211     tmpfs:
212       - /var/lib/mysql
213
214   - name: memcached
215     image: memcached
216
217   - name: redis
218     image: redis
219 ---
220 kind: pipeline
221 type: docker
222 name: php8.0-mariadb
223
224 steps:
225   - name: Restore cache
226     image: meltwater/drone-cache:dev
227     settings:
228       backend: "filesystem"
229       restore: true
230       cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
231       archive_format: "gzip"
232       mount:
233         - '.composer'
234     volumes:
235       - name: cache
236         path: /tmp/cache
237   - name: Composer install
238     image: friendicaci/php8.0:php8.0.5
239     commands:
240       - export COMPOSER_HOME=.composer
241       - ./bin/composer.phar validate
242       - ./bin/composer.phar install --prefer-dist
243   - name: Rebuild cache
244     image: meltwater/drone-cache:dev
245     settings:
246       backend: "filesystem"
247       rebuild: true
248       cache_key: '{{ .Repo.Name }}_php80_{{ arch }}_{{ os }}'
249       archive_format: "gzip"
250       mount:
251         - '.composer'
252     volumes:
253       - name: cache
254         path: /tmp/cache
255   - name: Test Friendica
256     image: friendicaci/php8.0:php8.0.5
257     environment:
258       MYSQL_HOST: "mariadb"
259       MYSQL_PORT: 3306
260       MYSQL_DATABASE: "test"
261       MYSQL_PASSWORD: "test"
262       MYSQL_USER: "test"
263       REDIS_HOST: "redis"
264       MEMCACHED_HOST: "memcached"
265       MEMCACHE_HOST: "memcached"
266     commands:
267       - cp config/local-sample.config.php config/local.config.php
268       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
269       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
270       - phpunit --configuration tests/phpunit.xml
271
272 services:
273   - name: mariadb
274     image: mariadb:latest
275     environment:
276       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
277       MYSQL_DATABASE: "test"
278       MYSQL_PASSWORD: "test"
279       MYSQL_USER: "test"
280     tmpfs:
281       - /var/lib/mysql
282
283   - name: memcached
284     image: memcached
285
286   - name: redis
287     image: redis