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