1 name: Testing Friendica
2 on: [push, pull_request]
6 name: Friendica (PHP ${{ matrix.php-versions }})
12 MYSQL_ALLOW_EMPTY_PASSWORD: true
18 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
23 options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
31 php-versions: ['7.2', '7.3', '7.4']
34 uses: actions/checkout@v2
36 - name: Setup PHP, with composer and extensions
37 uses: shivammathur/setup-php@v2
39 php-version: ${{ matrix.php-versions }}
41 extensions: pdo_mysql, gd, zip, opcache, ctype, pcntl, ldap, apcu, memcached, redis, imagick, memcache
43 ini-values: apc.enabled=1, apc.enable_cli=1
45 - name: Start mysql service
46 run: sudo /etc/init.d/mysql start
48 - name: Validate composer.json and composer.lock
49 run: composer validate
51 - name: Get composer cache directory
53 run: echo "::set-output name=dir::$(composer config cache-files-dir)"
55 - name: Cache dependencies
56 uses: actions/cache@v2
58 path: ${{ steps.composercache.outputs.dir }}
59 key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
60 restore-keys: ${{ runner.os }}-composer-
62 - name: Install dependencies
63 run: composer install --prefer-dist
65 - name: Copy default Friendica config
66 run: cp config/local-sample.config.php config/local.config.php
68 - name: Verify MariaDB connection
70 PORT: ${{ job.services.mariadb.ports[3306] }}
72 while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
76 - name: Setup MYSQL database
78 PORT: ${{ job.services.mariadb.ports[3306] }}
80 mysql -h"127.0.0.1" -P"$PORT" -utest -ptest test < database.sql
82 - name: Test with Parallel-lint
83 run: vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ .
85 - name: Test with phpunit
86 run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
89 MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
93 REDIS_PORT: ${{ job.services.redis.ports[6379] }}
95 MEMCACHED_PORT: ${{ job.services.memcached.ports[11211] }}
96 MEMCACHE_PORT: ${{ job.services.memcached.ports[11211] }}
98 - name: Upload coverage to Codecov
99 uses: codecov/codecov-action@v1