1 name: Testing Friendica
2 on: [push, pull_request, pull_request_review]
6 name: Friendica (PHP ${{ matrix.php-versions }})
13 MYSQL_USERNAME: travis
18 MYSQL_ALLOW_EMPTY_PASSWORD: true
21 MYSQL_USERNAME: travis
24 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
29 options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
37 php-versions: ['7.2', '7.3', '7.4']
40 uses: actions/checkout@v2
42 - name: Setup PHP, with composer and extensions
43 uses: shivammathur/setup-php@v2
45 php-version: ${{ matrix.php-versions }}
47 extensions: pdo_mysql, gd, zip, opcache, ctype, pcntl, ldap, apcu, memcached, redis, imagick
49 ini-values: apc.enabled=1, apc.enable_cli=1
51 - name: Start mysql service
52 run: sudo /etc/init.d/mysql start
54 - name: Validate composer.json and composer.lock
55 run: composer validate
57 - name: Get composer cache directory
59 run: echo "::set-output name=dir::$(composer config cache-files-dir)"
61 - name: Cache dependencies
62 uses: actions/cache@v2
64 path: ${{ steps.composercache.outputs.dir }}
65 key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
66 restore-keys: ${{ runner.os }}-composer-
68 - name: Install dependencies
69 run: composer install --prefer-dist
71 - name: Copy default Friendica config
72 run: cp config/local-sample.config.php config/local.config.php
74 - name: Verify MariaDB connection
76 PORT: ${{ job.services.mariadb.ports[3306] }}
78 while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
82 - name: Setup MYSQL database
84 PORT: ${{ job.services.mariadb.ports[3306] }}
86 mysql -h"127.0.0.1" -P"$PORT" -uroot -e 'CREATE DATABASE IF NOT EXISTS test;'
87 mysql -h"127.0.0.1" -P"$PORT" -uroot test < database.sql
89 - name: Test with Parallel-lint
90 run: vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ .
92 - name: Test with phpunit
93 run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
101 - name: Upload coverage to Codecov
102 uses: codecov/codecov-action@v1