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'] 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 39 - name: Setup problem matchers 40 run: | 41 echo ::add-matcher::${{ runner.tool_cache }}/php.json 42 echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json 43 44 - name: Setup PHPUnit 45 run: | 46 php _test/fetchphpunit.php 47 cd _test 48 cp mysql.conf.php.dist mysql.conf.php 49 cp pgsql.conf.php.dist pgsql.conf.php 50 51 - name: Run PHPUnit 52 run: | 53 cd _test 54 php phpunit.phar --verbose --stderr 55