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