]> git.mxchange.org Git - friendica.git/blob - .drone.yml
Drone & PHP tests
[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: Test Friendica
71     image: friendicaci/php7.3:php7.3.28
72     environment:
73       MYSQL_HOST: "mariadb"
74       MYSQL_PORT: 3306
75       MYSQL_DATABASE: "test"
76       MYSQL_PASSWORD: "test"
77       MYSQL_USER: "test"
78       REDIS_HOST: "redis"
79       MEMCACHED_HOST: "memcached"
80       MEMCACHE_HOST: "memcached"
81     commands:
82       - composer validate
83       - composer install --prefer-dist
84       - cp config/local-sample.config.php config/local.config.php
85       - while ! mysqladmin ping -h$MYSQL_HOST -P$MYSQL_PORT --silent; do sleep 1; done
86       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
87       - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
88   - name: Codecov
89     image: plugins/codecov
90     when:
91       repo:
92         - friendica/friendica
93     settings:
94       token:
95         from_secret: codecov-token
96       files:
97         - clover.xml
98
99 services:
100   - name: mariadb
101     image: mariadb:latest
102     environment:
103       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
104       MYSQL_DATABASE: "test"
105       MYSQL_PASSWORD: "test"
106       MYSQL_USER: "test"
107     tmpfs:
108       - /var/lib/mysql
109
110   - name: memcached
111     image: memcached
112
113   - name: redis
114     image: redis
115 ---
116 kind: pipeline
117 type: docker
118 name: php7.4-mariadb
119
120 steps:
121   - name: Test Friendica
122     image: friendicaci/php7.4:php7.4.18
123     environment:
124       MYSQL_HOST: "mariadb"
125       MYSQL_PORT: 3306
126       MYSQL_DATABASE: "test"
127       MYSQL_PASSWORD: "test"
128       MYSQL_USER: "test"
129       REDIS_HOST: "redis"
130       MEMCACHED_HOST: "memcached"
131       MEMCACHE_HOST: "memcached"
132     commands:
133       - composer validate
134       - composer install --prefer-dist
135       - cp config/local-sample.config.php config/local.config.php
136       - while ! mysqladmin ping -h$MYSQL_HOST -P$MYSQL_PORT --silent; do sleep 1; done
137       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
138       - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
139   - name: Codecov
140     image: plugins/codecov
141     when:
142       repo:
143         - friendica/friendica
144     settings:
145       token:
146         from_secret: codecov-token
147       files:
148         - clover.xml
149
150 services:
151   - name: mariadb
152     image: mariadb:latest
153     environment:
154       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
155       MYSQL_DATABASE: "test"
156       MYSQL_PASSWORD: "test"
157       MYSQL_USER: "test"
158     tmpfs:
159       - /var/lib/mysql
160
161   - name: memcached
162     image: memcached
163
164   - name: redis
165     image: redis
166 ---
167 kind: pipeline
168 type: docker
169 name: php8.0-mariadb
170
171 steps:
172   - name: Test Friendica
173     image: friendicaci/php8.0:php8.0.5
174     environment:
175       MYSQL_HOST: "mariadb"
176       MYSQL_PORT: 3306
177       MYSQL_DATABASE: "test"
178       MYSQL_PASSWORD: "test"
179       MYSQL_USER: "test"
180       REDIS_HOST: "redis"
181       MEMCACHED_HOST: "memcached"
182       MEMCACHE_HOST: "memcached"
183     commands:
184       - composer validate
185       - composer install --prefer-dist
186       - cp config/local-sample.config.php config/local.config.php
187       - while ! mysqladmin ping -h$MYSQL_HOST -P$MYSQL_PORT --silent; do sleep 1; done
188       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
189       - phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
190   - name: Codecov
191     image: plugins/codecov
192     when:
193       repo:
194         - friendica/friendica
195     settings:
196       token:
197         from_secret: codecov-token
198       files:
199         - clover.xml
200
201 services:
202   - name: mariadb
203     image: mariadb:latest
204     environment:
205       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
206       MYSQL_DATABASE: "test"
207       MYSQL_PASSWORD: "test"
208       MYSQL_USER: "test"
209     tmpfs:
210       - /var/lib/mysql
211
212   - name: memcached
213     image: memcached
214
215   - name: redis
216     image: redis