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