]> git.mxchange.org Git - friendica-addons.git/blob - .woodpecker/.phpunit.yml
5450f0e7da78b861ac3119d89e0b3d5ed8f0e900
[friendica-addons.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 skip_clone: true
19
20 pipeline:
21   clone_friendica_base:
22     image: alpine/git
23     commands:
24       - git clone https://github.com/friendica/friendica.git .
25       - git checkout $CI_COMMIT_BRANCH
26   clone_friendica_addon:
27     image: alpine/git
28     commands:
29       - git config --global user.email "no-reply@friendi.ca"
30       - git config --global user.name "Friendica"
31       - git clone $CI_REPO_LINK addon
32       - cd addon/
33       - git checkout $CI_COMMIT_BRANCH
34       - git fetch origin $CI_COMMIT_REF
35       - git merge $CI_COMMIT_SHA
36   restore_cache:
37     image: meltwater/drone-cache:dev
38     settings:
39       backend: "filesystem"
40       restore: true
41       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
42       archive_format: "gzip"
43       mount:
44         - '.composer'
45     volumes:
46       - /tmp/drone-cache:/tmp/cache
47   composer_install:
48     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
49     commands:
50       - export COMPOSER_HOME=.composer
51       - ./bin/composer.phar validate
52       - ./bin/composer.phar install --prefer-dist
53     volumes:
54       - /etc/hosts:/etc/hosts
55   rebuild_cache:
56     image: meltwater/drone-cache:dev
57     settings:
58       backend: "filesystem"
59       rebuild: true
60       cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
61       archive_format: "gzip"
62       mount:
63         - '.composer'
64     volumes:
65       - /tmp/drone-cache:/tmp/cache
66   test:
67     image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
68     environment:
69       MYSQL_HOST: "mariadb"
70       MYSQL_PORT: "3306"
71       MYSQL_DATABASE: "test"
72       MYSQL_PASSWORD: "test"
73       MYSQL_USER: "test"
74       REDIS_HOST: "redis"
75       MEMCACHED_HOST: "memcached"
76       MEMCACHE_HOST: "memcached"
77     commands:
78       - cp config/local-sample.config.php config/local.config.php
79       - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
80       - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
81       - if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then
82           phpenmod xdebug;
83           export XDEBUG_MODE=coverage;
84           phpunit --configuration tests/phpunit-addons.xml --coverage-clover clover.xml;
85         else
86           phpunit --configuration tests/phpunit-addons.xml;
87         fi
88   codecov:
89     image: friendicaci/codecov
90     when:
91       matrix:
92         PHP_MAJOR_VERSION: 7.4
93         PHP_VERSION: 7.4.33
94       repo:
95         - friendica/friendica-addons
96     commands:
97       - codecov -R '.' -Z -f 'clover.xml'
98     secrets:
99       - source: codecov-token
100         target: codecov_token
101
102 services:
103   mariadb:
104     image: mariadb:latest
105     environment:
106       MYSQL_ALLOW_EMPTY_PASSWORD: "true"
107       MYSQL_DATABASE: "test"
108       MYSQL_PASSWORD: "test"
109       MYSQL_USER: "test"
110
111   memcached:
112     image: memcached
113
114   redis:
115     image: redis
116