1name: Linux Unit Tests 2 3on: [push, pull_request] 4 5jobs: 6 run: 7 name: PHP ${{ matrix.php-versions }} 8 runs-on: ubuntu-latest 9 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository 10 11 strategy: 12 matrix: 13 php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] 14 fail-fast: false 15 16 services: 17 mysql: 18 image: mysql:5.7 19 env: 20 MYSQL_ALLOW_EMPTY_PASSWORD: yes 21 ports: 22 - 3306:3306 23 postgres: 24 image: postgres:latest 25 env: 26 POSTGRES_PASSWORD: postgres 27 ports: 28 - 5432:5432 29 steps: 30 - name: Checkout 31 uses: actions/checkout@v2 32 33 - name: Setup PHP 34 uses: shivammathur/setup-php@v2 35 with: 36 php-version: ${{ matrix.php-versions }} 37 extensions: mbstring, intl, PDO, pdo_sqlite, pdo_mysql, pdo_pgsql, bz2 38 ini-values: pcre.jit=0 39 40 - name: Setup problem matchers 41 run: | 42 echo ::add-matcher::${{ runner.tool_cache }}/php.json 43 echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json 44 45 - name: Setup PHPUnit 46 run: | 47 php _test/fetchphpunit.php 48 cd _test 49 cp mysql.conf.php.dist mysql.conf.php 50 cp pgsql.conf.php.dist pgsql.conf.php 51 52 - name: Run PHPUnit 53 run: | 54 cd _test 55 php phpunit.phar --verbose --stderr 56