friendica-addons/.woodpecker/.phpunit.yml

119 lines
3.5 KiB
YAML
Raw Normal View History

2023-07-22 21:57:38 +00:00
matrix:
include:
- PHP_MAJOR_VERSION: 7.4
PHP_VERSION: 7.4.33
- PHP_MAJOR_VERSION: 8.0
2023-10-12 19:33:03 +00:00
PHP_VERSION: 8.0.30
2023-07-22 21:57:38 +00:00
- PHP_MAJOR_VERSION: 8.1
2024-03-15 22:03:44 +00:00
PHP_VERSION: 8.1.27
2023-07-22 21:57:38 +00:00
- PHP_MAJOR_VERSION: 8.2
2024-03-15 22:03:44 +00:00
PHP_VERSION: 8.2.16
2024-03-15 21:55:48 +00:00
- PHP_MAJOR_VERSION: 8.3
PHP_VERSION: 8.3.3
2023-07-22 21:57:38 +00:00
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
labels:
location: opensocial
skip_clone: true
pipeline:
clone_friendica_base:
image: alpine/git
commands:
2024-08-20 16:07:51 +00:00
- git config --global user.email "no-reply@friendi.ca"
- git config --global user.name "Friendica"
- git config --global --add safe.directory $CI_WORKSPACE
2023-07-22 21:57:38 +00:00
- git clone https://github.com/friendica/friendica.git .
- git checkout $CI_COMMIT_BRANCH
clone_friendica_addon:
image: alpine/git
commands:
- git config --global user.email "no-reply@friendi.ca"
- git config --global user.name "Friendica"
2024-03-22 14:53:47 +00:00
- git clone $CI_REPO_CLONE_URL addon
2023-07-22 21:57:38 +00:00
- cd addon/
- git checkout $CI_COMMIT_BRANCH
- git fetch origin $CI_COMMIT_REF
- git merge $CI_COMMIT_SHA
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 22:15:42 +00:00
- if [ "${PHP_MAJOR_VERSION}" = "8.2" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then
2023-07-22 21:57:38 +00:00
phpenmod xdebug;
export XDEBUG_MODE=coverage;
phpunit --configuration tests/phpunit-addons.xml --coverage-clover clover.xml;
else
phpunit --configuration tests/phpunit-addons.xml;
fi
codecov:
image: friendicaci/codecov
when:
matrix:
2024-03-15 22:06:13 +00:00
PHP_MAJOR_VERSION: 8.2
PHP_VERSION: 8.2.16
2023-07-22 21:57:38 +00:00
repo:
- friendica/friendica-addons
commands:
- codecov -R '.' -Z -f 'clover.xml'
2024-12-22 07:38:17 +00:00
environment:
2024-12-22 07:54:51 +00:00
CODECOV_TOKEN:
2024-12-22 07:38:17 +00:00
from_secret: codecov-token
2023-07-22 21:57:38 +00:00
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