Files
wp-plugin-starter-template-…/.github/workflows/tests.yml
marcusquinn eb0a3860ff fix: re-enable PHPUnit test step in tests.yml
Tests were commented out in PR #10. PHPUnit test files exist in
tests/phpunit/ and phpunit.xml is configured. Re-enabling the step
so tests actually run in CI.

Closes #45
2026-03-16 20:11:11 +00:00

72 lines
1.6 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: Clear Composer Cache
run: composer clear-cache
- name: Install dependencies
run: composer install --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: Clear Composer Cache
run: composer clear-cache
- name: Install dependencies
run: composer install --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