]> git.mxchange.org Git - friendica.git/blob - .woodpecker/.phpunit.yml
Resubscribe to relay servers
[friendica.git] / .woodpecker / .phpunit.yml
1 matrix:
2   include:
3     - PHP_MAJOR_VERSION: 7.3
4       PHP_VERSION: 7.3.28
5     - PHP_MAJOR_VERSION: 7.4
6       PHP_VERSION: 7.4.18
7     - PHP_MAJOR_VERSION: 8.0
8       PHP_VERSION: 8.0.5
9
10 pipeline:
11   php-lint:
12     image: php:${PHP_MAJOR_VERSION}
13     group: lint
14     commands:
15       - ./bin/composer.phar run lint
16   restore_cache:
17     image: meltwater/drone-cache:dev
18     settings:
19       backend: "filesystem"
20       restore: true
21       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
22       archive_format: "gzip"
23       mount:
24         - '.composer'
25     volumes:
26       - /tmp/drone-cache:/tmp/cache
27   composer_install:
28     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
29     commands:
30       - export COMPOSER_HOME=.composer
31       - ./bin/composer.phar validate
32       - ./bin/composer.phar install --prefer-dist
33     volumes:
34       - /etc/hosts:/etc/hosts
35   rebuild_cache:
36     image: meltwater/drone-cache:dev
37     settings:
38       backend: "filesystem"
39       rebuild: true
40       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
41       archive_format: "gzip"
42       mount:
43         - '.composer'
44     volumes:
45       - /tmp/drone-cache:/tmp/cache
46   test:
47     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
48     environment:
49       MYSQL_HOST: "mariadb"
50       MYSQL_PORT: "3306"
51       MYSQL_DATABASE: "test"
52       MYSQL_PASSWORD: "test"
53       MYSQL_USER: "test"
54       REDIS_HOST: "redis"
55       MEMCACHED_HOST: "memcached"
56       MEMCACHE_HOST: "memcached"
57     commands:
58       - cp config/local-sample.config.php config/local.config.php
59       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
60       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
61       - if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica" ]; then
62           phpenmod xdebug;
63           export XDEBUG_MODE=coverage;
64           phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml;
65         else
66           phpunit --configuration tests/phpunit.xml;
67         fi
68
69   codecov:
70     image: plugins/codecov
71     when:
72       matrix:
73         PHP_MAJOR_VERSION: 7.4
74         PHP_VERSION: 7.4.18
75       repo:
76         - friendica/friendica
77     settings:
78       token:
79         from_secret: codecov-token
80       files:
81         - clover.xml
82
83 services:
84   mariadb:
85     image: mariadb:latest
86     environment:
87       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
88       MYSQL_DATABASE: "test"
89       MYSQL_PASSWORD: "test"
90       MYSQL_USER: "test"
91
92   memcached:
93     image: memcached
94
95   redis:
96     image: redis