]> git.mxchange.org Git - friendica.git/blob - .drone.yml
Add cache for PHP 7.3 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: Composer install
145     image: friendicaci/php7.4:php7.4.18
146     commands:
147       - composer validate
148       - composer install --prefer-dist
149   - name: Test Friendica
150     image: friendicaci/php7.4:php7.4.18
151     environment:
152       MYSQL_HOST: "mariadb"
153       MYSQL_PORT: 3306
154       MYSQL_DATABASE: "test"
155       MYSQL_PASSWORD: "test"
156       MYSQL_USER: "test"
157       REDIS_HOST: "redis"
158       MEMCACHED_HOST: "memcached"
159       MEMCACHE_HOST: "memcached"
160       XDEBUG_MODE: "coverage"
161     commands:
162       - phpenmod xdebug
163       - cp config/local-sample.config.php config/local.config.php
164       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
165       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
166       - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
167   - name: Codecov
168     image: plugins/codecov
169     when:
170       repo:
171         - friendica/friendica
172     settings:
173       token:
174         from_secret: codecov-token
175       files:
176         - clover.xml
177
178 services:
179   - name: mariadb
180     image: mariadb:latest
181     environment:
182       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
183       MYSQL_DATABASE: "test"
184       MYSQL_PASSWORD: "test"
185       MYSQL_USER: "test"
186     tmpfs:
187       - /var/lib/mysql
188
189   - name: memcached
190     image: memcached
191
192   - name: redis
193     image: redis
194 ---
195 kind: pipeline
196 type: docker
197 name: php8.0-mariadb
198
199 steps:
200   - name: Composer install
201     image: friendicaci/php7.4:php7.4.18
202     commands:
203       - composer validate
204       - composer install --prefer-dist
205   - name: Test Friendica
206     image: friendicaci/php8.0:php8.0.5
207     environment:
208       MYSQL_HOST: "mariadb"
209       MYSQL_PORT: 3306
210       MYSQL_DATABASE: "test"
211       MYSQL_PASSWORD: "test"
212       MYSQL_USER: "test"
213       REDIS_HOST: "redis"
214       MEMCACHED_HOST: "memcached"
215       MEMCACHE_HOST: "memcached"
216     commands:
217       - cp config/local-sample.config.php config/local.config.php
218       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
219       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
220       - phpunit --configuration tests/phpunit.xml
221
222 services:
223   - name: mariadb
224     image: mariadb:latest
225     environment:
226       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
227       MYSQL_DATABASE: "test"
228       MYSQL_PASSWORD: "test"
229       MYSQL_USER: "test"
230     tmpfs:
231       - /var/lib/mysql
232
233   - name: memcached
234     image: memcached
235
236   - name: redis
237     image: redis