Skip to content

Maker sure Steps::$scripts is an array #7

Maker sure Steps::$scripts is an array

Maker sure Steps::$scripts is an array #7

Workflow file for this run

name: PHP Tests
on:
push:
paths:
- '**workflows/php-tests.yml'
- '**.php'
- '**templates/**'
- '**phpunit.xml.dist'
- '**composer.json'
pull_request:
paths:
- '**workflows/php-tests.yml'
- '**.php'
- '**templates/**'
- '**phpunit.xml.dist'
- '**composer.json'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip tests') }}
env:
USE_COVERAGE: no
strategy:
fail-fast: false
matrix:
php-ver: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
composer-ver: [ '~2.3.0', '~2.4.0', '~2.5.0', '~2.6.0', '~2.7.0', '~2.8.0' ]
exclude:
- php-ver: '8.4'
composer-ver: '~2.3.0'
steps:
- name: Update "USE_COVERAGE" env var based on matrix
if: ${{ matrix.php-ver == '8.1' && matrix.composer-ver == '~2.8.0' }}
run: echo "USE_COVERAGE=yes" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-ver }}
ini-values: zend.assertions=1, error_reporting=E_ALL, display_errors=On
coverage: ${{ ((env.USE_COVERAGE == 'yes') && 'xdebug') || 'none' }}
- name: Adjust Composer dependencies
run: |
composer remove --dev --no-update "roave/security-advisories"
composer remove --dev --no-update "inpsyde/php-coding-standards"
composer remove --dev --no-update "phpstan/phpstan"
composer remove --dev --no-update "phpstan/phpstan-strict-rules"
composer require --dev --no-update "composer/composer:${{ matrix.composer-ver }}"
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run tests
run: ./vendor/bin/phpunit ${{ ((env.USE_COVERAGE == 'yes') && '--coverage-html=coverage-report') || '--no-coverage' }}
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: ${{ env.USE_COVERAGE == 'yes' }}
with:
name: coverage-report
path: coverage-report/