2021-12-18 20:28:14 +01:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- PHP_MAJOR_VERSION: 7.3
|
2022-11-09 22:50:55 +01:00
|
|
|
PHP_VERSION: 7.3.33
|
2021-12-18 20:28:14 +01:00
|
|
|
- PHP_MAJOR_VERSION: 7.4
|
2022-11-09 22:50:55 +01:00
|
|
|
PHP_VERSION: 7.4.33
|
2021-12-18 20:28:14 +01:00
|
|
|
- PHP_MAJOR_VERSION: 8.0
|
2022-11-09 22:50:55 +01:00
|
|
|
PHP_VERSION: 8.0.25
|
2022-12-04 14:53:14 +01:00
|
|
|
- PHP_MAJOR_VERSION: 8.1
|
|
|
|
PHP_VERSION: 8.1.12
|
2021-12-18 20:28:14 +01:00
|
|
|
|
2022-12-04 15:06:10 +01:00
|
|
|
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
|
|
|
|
labels:
|
|
|
|
location: opensocial
|
|
|
|
|
2021-12-18 20:28:14 +01:00
|
|
|
pipeline:
|
|
|
|
php-lint:
|
|
|
|
image: php:${PHP_MAJOR_VERSION}
|
|
|
|
group: lint
|
|
|
|
commands:
|
|
|
|
- ./bin/composer.phar run lint
|
|
|
|
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
|
|
|
|
- if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica" ]; then
|
|
|
|
phpenmod xdebug;
|
|
|
|
export XDEBUG_MODE=coverage;
|
|
|
|
phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml;
|
|
|
|
else
|
|
|
|
phpunit --configuration tests/phpunit.xml;
|
|
|
|
fi
|
|
|
|
codecov:
|
2023-04-01 21:52:02 +02:00
|
|
|
image: friendicaci/codecov
|
2021-12-18 20:28:14 +01:00
|
|
|
when:
|
|
|
|
matrix:
|
|
|
|
PHP_MAJOR_VERSION: 7.4
|
2023-03-26 22:44:55 +02:00
|
|
|
PHP_VERSION: 7.4.33
|
2021-12-18 20:28:14 +01:00
|
|
|
repo:
|
|
|
|
- friendica/friendica
|
2023-04-01 21:52:02 +02:00
|
|
|
commands:
|
|
|
|
- curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
|
|
|
|
- curl -Os https://uploader.codecov.io/latest/alpine/codecov
|
|
|
|
- curl -Os https://uploader.codecov.io/latest/alpine/codecov.SHA256SUM
|
|
|
|
- curl -Os https://uploader.codecov.io/latest/alpine/codecov.SHA256SUM.sig
|
|
|
|
- gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
|
|
|
|
- shasum -a 256 -c codecov.SHA256SUM
|
|
|
|
- chmod +x codecov
|
|
|
|
- ./codecov -B ${CI_COMMIT_BRANCH} -C ${CI_COMMIT_SHA} -P ${CI_COMMIT_PULL_REQUEST} -b ${CI_PIPELINE_NUMBER} -Z -f 'clover.xml'
|
|
|
|
secrets:
|
|
|
|
- source: codecov-token
|
|
|
|
target: codecov_token
|
2021-12-18 20:28:14 +01: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
|