]> git.mxchange.org Git - friendica.git/blobdiff - .github/workflows/php.yml
Use the system user for uid=0
[friendica.git] / .github / workflows / php.yml
index 3da7ee8796febf65ecfdcf93e03a32b3800b1ba4..91a8b60747aa4b3443ce63b675b6d39ceff820ec 100644 (file)
@@ -1,24 +1,18 @@
 name: Testing Friendica
-on: [push, pull_request, pull_request_review]
+on: [push, pull_request]
 
 jobs:
   friendica:
     name: Friendica (PHP ${{ matrix.php-versions }})
     runs-on: ubuntu-latest
-    env:
-      MYSQL_HOST: localhost
-      MYSQL_PORT: 3306
-      MYSQL_DATABASE: test
-      MYSQL_PASSWORD: ""
-      MYSQL_USERNAME: travis
     services:
       mariadb:
         image: mariadb:latest
         env:
           MYSQL_ALLOW_EMPTY_PASSWORD: true
           MYSQL_DATABASE: test
-          MYSQL_PASSWORD: ""
-          MYSQL_USERNAME: travis
+          MYSQL_PASSWORD: test
+          MYSQL_USER: test
         ports:
           - 3306/tcp
         options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
@@ -43,8 +37,8 @@ jobs:
         uses: shivammathur/setup-php@v2
         with:
           php-version: ${{ matrix.php-versions }}
-          tools: pecl
-          extensions: pdo_mysql, gd, zip, opcache, ctype, pcntl, ldap, apcu, memcached, redis, imagick
+          tools: pecl, composer:v1
+          extensions: pdo_mysql, gd, zip, opcache, ctype, pcntl, ldap, apcu, memcached, redis, imagick, memcache
           coverage: xdebug
           ini-values: apc.enabled=1, apc.enable_cli=1
 
@@ -83,8 +77,7 @@ jobs:
         env:
           PORT: ${{ job.services.mariadb.ports[3306] }}
         run: |
-          mysql -h"127.0.0.1" -P"$PORT" -uroot -e 'CREATE DATABASE IF NOT EXISTS test;'
-          mysql -h"127.0.0.1" -P"$PORT" -uroot test < database.sql
+          mysql -h"127.0.0.1" -P"$PORT" -utest -ptest test < database.sql
 
       - name: Test with Parallel-lint
         run: vendor/bin/parallel-lint --exclude vendor/ --exclude view/asset/ .
@@ -92,13 +85,17 @@ jobs:
       - name: Test with phpunit
         run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
         env:
-          MYSQL_HOST: localhost
-          MYSQL_PORT: 3306
+          MYSQL_HOST: 127.0.0.1
+          MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
           MYSQL_DATABASE: test
-          MYSQL_PASSWORD: ""
-          MYSQL_USERNAME: root
+          MYSQL_PASSWORD: test
+          MYSQL_USER: test
+          REDIS_PORT: ${{ job.services.redis.ports[6379] }}
+          REDIS_HOST: 127.0.0.1
+          MEMCACHED_PORT: ${{ job.services.memcached.ports[11211] }}
+          MEMCACHE_PORT: ${{ job.services.memcached.ports[11211] }}
 
       - name: Upload coverage to Codecov
         uses: codecov/codecov-action@v1
         with:
-          file: clover.xml
\ No newline at end of file
+          file: clover.xml