Replace bare 'composer install' with ramsey/composer-install action (which provides built-in retry, caching, and --prefer-dist) in code-quality.yml and tests.yml. Add a 3-attempt shell retry loop in release.yml where --no-dev --optimize-autoloader flags are required. phpunit.yml already used ramsey/composer-install and is unaffected. Closes #57
70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
name: Tests - Run PHP compatibility and unit tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
name: PHP ${{ matrix.php-versions }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php-versions: ['7.4', '8.0']
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
clean: 'true'
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
extensions: mbstring, intl, zip
|
|
tools: composer:v2
|
|
|
|
- name: Install dependencies
|
|
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
|
|
with:
|
|
composer-options: "--prefer-dist --no-progress"
|
|
|
|
- name: Run tests
|
|
run: ./vendor/bin/phpunit
|
|
|
|
code-style:
|
|
name: Code Style
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
clean: 'true'
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '7.4'
|
|
extensions: mbstring, intl, zip
|
|
tools: composer:v2, phpcs
|
|
|
|
- name: Install dependencies
|
|
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
|
|
with:
|
|
composer-options: "--prefer-dist --no-progress"
|
|
|
|
- name: Run PHPCS
|
|
run: composer run phpcs
|
|
continue-on-error: true
|
|
|
|
- name: Run PHPCBF (report only)
|
|
run: |
|
|
echo "Running PHPCBF in dry-run mode to show what would be fixed"
|
|
composer run phpcbf -- --dry-run
|
|
continue-on-error: true
|