]> git.mxchange.org Git - friendica.git/blob - .woodpecker/.phpunit.yml
Fix a problem with MySQL
[friendica.git] / .woodpecker / .phpunit.yml
1 matrix:
2   include:
3     - PHP_MAJOR_VERSION: 7.4
4       PHP_VERSION: 7.4.33
5     - PHP_MAJOR_VERSION: 8.0
6       PHP_VERSION: 8.0.30
7     - PHP_MAJOR_VERSION: 8.1
8       PHP_VERSION: 8.1.23
9     - PHP_MAJOR_VERSION: 8.2
10       PHP_VERSION: 8.2.11
11
12 # This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
13 labels:
14   location: opensocial
15
16 steps:
17   php-lint:
18     image: php:${PHP_MAJOR_VERSION}
19     group: lint
20     commands:
21       - find . -name \*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l
22   restore_cache:
23     image: meltwater/drone-cache:dev
24     settings:
25       backend: "filesystem"
26       restore: true
27       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
28       archive_format: "gzip"
29       mount:
30         - '.composer'
31     volumes:
32       - /tmp/drone-cache:/tmp/cache
33   composer_install:
34     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
35     commands:
36       - export COMPOSER_HOME=.composer
37       - ./bin/composer.phar validate
38       - ./bin/composer.phar install --prefer-dist
39     volumes:
40       - /etc/hosts:/etc/hosts
41   rebuild_cache:
42     image: meltwater/drone-cache:dev
43     settings:
44       backend: "filesystem"
45       rebuild: true
46       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
47       archive_format: "gzip"
48       mount:
49         - '.composer'
50     volumes:
51       - /tmp/drone-cache:/tmp/cache
52   test:
53     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
54     environment:
55       MYSQL_HOST: "mariadb"
56       MYSQL_PORT: "3306"
57       MYSQL_DATABASE: "test"
58       MYSQL_PASSWORD: "test"
59       MYSQL_USER: "test"
60       REDIS_HOST: "redis"
61       MEMCACHED_HOST: "memcached"
62       MEMCACHE_HOST: "memcached"
63     commands:
64       - cp config/local-sample.config.php config/local.config.php
65       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
66       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
67       - if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica" ]; then
68           phpenmod xdebug;
69           export XDEBUG_MODE=coverage;
70           phpunit --configuration tests/phpunit.xml -d memory_limit=-1 --coverage-clover clover.xml;
71         else
72           phpunit --configuration tests/phpunit.xml -d memory_limit=-1;
73         fi
74   codecov:
75     image: friendicaci/codecov
76     when:
77       matrix:
78         PHP_MAJOR_VERSION: 7.4
79         PHP_VERSION: 7.4.33
80       repo:
81         - friendica/friendica
82     commands:
83       - codecov -R '.' -Z -f 'clover.xml'
84     secrets:
85       - source: codecov-token
86         target: codecov_token
87
88 services:
89   mariadb:
90     image: mariadb:latest
91     environment:
92       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
93       MYSQL_DATABASE: "test"
94       MYSQL_PASSWORD: "test"
95       MYSQL_USER: "test"
96
97   memcached:
98     image: memcached
99
100   redis:
101     image: redis