Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Distribution ignore file - files NOT deployed to WordPress.org SVN

# Development dependencies
/vendor/
/node_modules/

# Development configs
.distignore
.gitignore
.gitattributes
.editorconfig
composer.json
composer.lock
package.json
package-lock.json
phpcs.xml.dist
phpstan.neon
phpunit.xml.dist

# Tests
/tests/
/coverage/
.phpunit.result.cache

# CI/CD
/.github/

# Documentation
CONTRIBUTING.md
readme.md
CODE_OF_CONDUCT.md

# IDE
/.idea/
/.vscode/
*.code-workspace

# OS files
.DS_Store
Thumbs.db

# Build artifacts
/build/

# Git
.git/
.gitmodules
116 changes: 104 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ on:

jobs:
# PHP Syntax Check across multiple versions
lint:
name: PHP Lint
php-lint:
name: PHP Syntax Check
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
php: ['7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v4
Expand All @@ -25,9 +25,34 @@ jobs:
php-version: ${{ matrix.php }}

- name: Check PHP syntax
run: find . -name "*.php" -not -path "./vendor/*" -print0 | xargs -0 -n1 php -l
run: find . -name "*.php" -not -path "./vendor/*" -not -path "./tests/*" -print0 | xargs -0 -n1 php -l

# WordPress Coding Standards
# JavaScript & CSS Linting
js-css-lint:
name: JS/CSS Lint (WordPress Standards)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint JavaScript (ESLint + WordPress)
run: npm run lint:js
continue-on-error: true

- name: Lint CSS (Stylelint + WordPress)
run: npm run lint:css
continue-on-error: true

# WordPress Coding Standards (PHPCS)
phpcs:
name: WordPress Coding Standards
runs-on: ubuntu-latest
Expand All @@ -41,11 +66,78 @@ jobs:
php-version: '8.1'
tools: cs2pr

- name: Install WordPress Coding Standards
run: |
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require --dev wp-coding-standards/wpcs:"^3.0" phpcsstandards/phpcsutils dealerdirect/phpcodesniffer-composer-installer

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPCS
run: ~/.composer/vendor/bin/phpcs --standard=WordPress-Core --extensions=php --ignore=vendor,node_modules . --report=checkstyle -q | cs2pr
continue-on-error: true
run: composer phpcs -- -q -n --report=checkstyle | cs2pr

# Static Analysis with PHPStan
phpstan:
name: PHPStan Static Analysis
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPStan
run: composer phpstan -- --memory-limit=1G

# Unit Tests with Coverage
test:
name: PHPUnit Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

# Code Coverage (only on main PHP version)
coverage:
name: Code Coverage
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: xdebug

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Generate coverage report
run: composer test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage/clover.xml
fail_ci_if_error: false
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,26 @@ Thumbs.db

# Ignore configuration files
# *.yml # Removed to allow GitHub Actions
*.json
# *.json # Removed to allow composer.json

# Ignore Composer files
composer.phar
composer.lock
/vendor/

# Ignore NPM files

# Ignore test coverage
/coverage/
.phpunit.result.cache

# Ignore E2E tests (run against live WordPress - dangerous)
/tests/e2e-test.php
/tests/test-bulk-batch.php

# Ignore internal docs
/docs/

# Ignore local development files
*.sql
*.sql.gz
Expand Down
Loading
Loading