Skip to content

Github action tweak #348

Github action tweak

Github action tweak #348

Workflow file for this run

name: Run PHP Tests and Code Quality Tools
on:
push:
branches: [ 2.X ]
pull_request:
branches: [ 2.X ]
schedule:
# Also run every Sunday at midnight
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.0, 7.4, 7.3, 7.2]
# prefer-lowest is causing unit tests to fail when php 7.2 is run against PHPunit 7.x,
# PHPUnit 8.x is the latest stable release that supports PHP 7.2 and that runs fine
# dependency-version: [prefer-lowest, prefer-stable]
dependency-version: [prefer-stable]
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
php: 7.2
- os: ubuntu-20.04
php: 7.3
- os: ubuntu-20.04
php: 7.4
- os: ubuntu-20.04
php: 8.0
# exclude:
# - os: ubuntu-20.04
# php: 7.3
name: PHP-${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: pcre.jit=0, pcre.backtrack_limit=9999999, pcre.recursion_limit=9999999
coverage: none
- name: PHP version
run: php -v
- name: Composer version
run: composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install Dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run PHPUnit Test Suite
run: vendor/bin/phpunit
# - name: Run Rector
# # Run rector for PHP 7.X but not 8.0, rector is currently blowing up with PHP 8.0
# #if: matrix.php != '8.0'
# run: vendor/bin/rector process src --dry-run
- name: Run Psalm
# Run psalm for PHP 7.X
if: matrix.php != '8.0'
run: vendor/bin/psalm