]> git.mxchange.org Git - friendica.git/blob - .woodpecker/.phpunit.yml
spelling: preview
[friendica.git] / .woodpecker / .phpunit.yml
1 matrix:
2   include:
3     - PHP_MAJOR_VERSION: 7.3
4       PHP_VERSION: 7.3.33
5     - PHP_MAJOR_VERSION: 7.4
6       PHP_VERSION: 7.4.33
7     - PHP_MAJOR_VERSION: 8.0
8       PHP_VERSION: 8.0.25
9     - PHP_MAJOR_VERSION: 8.1
10       PHP_VERSION: 8.1.12
11
12 # This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
13 labels:
14   location: opensocial
15
16 pipeline:
17   php-lint:
18     image: php:${PHP_MAJOR_VERSION}
19     group: lint
20     commands:
21       - ./bin/composer.phar run lint
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 --coverage-clover clover.xml;
71         else
72           phpunit --configuration tests/phpunit.xml;
73         fi
74
75   codecov:
76     image: plugins/codecov
77     when:
78       matrix:
79         PHP_MAJOR_VERSION: 7.4
80         PHP_VERSION: 7.4.18
81       repo:
82         - friendica/friendica
83     settings:
84       token:
85         from_secret: codecov-token
86       files:
87         - clover.xml
88
89 services:
90   mariadb:
91     image: mariadb:latest
92     environment:
93       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
94       MYSQL_DATABASE: "test"
95       MYSQL_PASSWORD: "test"
96       MYSQL_USER: "test"
97
98   memcached:
99     image: memcached
100
101   redis:
102     image: redis