friendica/.woodpecker/.phpunit.yml

103 lines
3.0 KiB
YAML
Raw Permalink Normal View History

matrix:
include:
- PHP_MAJOR_VERSION: 7.4
2022-11-09 16:50:55 -05:00
PHP_VERSION: 7.4.33
- PHP_MAJOR_VERSION: 8.0
2023-10-12 15:33:03 -04:00
PHP_VERSION: 8.0.30
2022-12-04 08:53:14 -05:00
- PHP_MAJOR_VERSION: 8.1
2024-03-15 18:03:44 -04:00
PHP_VERSION: 8.1.27
- PHP_MAJOR_VERSION: 8.2
2024-03-15 18:03:44 -04:00
PHP_VERSION: 8.2.16
2024-03-15 17:55:48 -04:00
- PHP_MAJOR_VERSION: 8.3
PHP_VERSION: 8.3.3
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
labels:
location: opensocial
steps:
php-lint:
image: php:${PHP_MAJOR_VERSION}
commands:
2023-07-28 13:02:08 -04:00
- find . -name \*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l
restore_cache:
image: meltwater/drone-cache:dev
settings:
backend: "filesystem"
restore: true
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
archive_format: "gzip"
mount:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
composer_install:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
commands:
- export COMPOSER_HOME=.composer
- ./bin/composer.phar validate
- ./bin/composer.phar install --prefer-dist
volumes:
- /etc/hosts:/etc/hosts
rebuild_cache:
image: meltwater/drone-cache:dev
settings:
backend: "filesystem"
rebuild: true
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
archive_format: "gzip"
mount:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
test:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
environment:
MYSQL_HOST: "mariadb"
MYSQL_PORT: "3306"
MYSQL_DATABASE: "test"
MYSQL_PASSWORD: "test"
MYSQL_USER: "test"
REDIS_HOST: "redis"
MEMCACHED_HOST: "memcached"
MEMCACHE_HOST: "memcached"
commands:
- cp config/local-sample.config.php config/local.config.php
- if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
- mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
2024-03-15 18:06:13 -04:00
- if [ "${PHP_MAJOR_VERSION}" = "8.2" -a "${CI_REPO}" = "friendica/friendica" ]; then
phpenmod xdebug;
export XDEBUG_MODE=coverage;
phpunit --configuration tests/phpunit.xml -d memory_limit=-1 --coverage-clover clover.xml;
else
phpunit --configuration tests/phpunit.xml -d memory_limit=-1;
fi
codecov:
2023-04-01 15:52:02 -04:00
image: friendicaci/codecov
when:
matrix:
2024-03-15 18:06:13 -04:00
PHP_MAJOR_VERSION: 8.2
PHP_VERSION: 8.2.16
repo:
- friendica/friendica
2023-04-01 15:52:02 -04:00
commands:
2023-04-01 16:00:57 -04:00
- codecov -R '.' -Z -f 'clover.xml'
2023-04-01 15:52:02 -04:00
secrets:
- source: codecov-token
target: codecov_token
services:
mariadb:
image: mariadb:latest
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_DATABASE: "test"
MYSQL_PASSWORD: "test"
MYSQL_USER: "test"
memcached:
image: memcached
redis:
image: redis