Migrate workflows to MokoStandards reusable workflow architecture #42

Merged
Copilot merged 5 commits from copilot/consolidate-workflows into main 2026-01-09 02:24:11 +00:00
3 changed files with 416 additions and 450 deletions
Showing only changes of commit 723f74043e - Show all commits

View File

@@ -18,8 +18,9 @@ permissions:
contents: read
jobs:
ci:
name: Repository Validation Pipeline
# Repository Validation
validation:
name: Repository Validation
runs-on: ubuntu-latest
env:
@@ -67,16 +68,425 @@ jobs:
python3 scripts/validate/version_alignment.py || echo "version_alignment validation not yet converted"
python3 scripts/validate/version_hierarchy.py || echo "version_hierarchy validation not yet converted"
- name: CI summary
- name: Validation Summary
if: always()
run: |
{
echo "### CI Execution Summary"
echo "### Repository Validation Summary"
echo ""
echo "- Repository: $GITHUB_REPOSITORY"
echo "- Branch: $GITHUB_REF_NAME"
echo "- Commit: $GITHUB_SHA"
echo "- Runner: ubuntu-latest"
echo ""
echo "CI completed. Review logs above for validation outcomes."
echo "Validation completed. Review logs above for details."
} >> "$GITHUB_STEP_SUMMARY"
# PHP Code Quality Checks
copilot-pull-request-reviewer[bot] commented 2026-01-09 02:30:08 +00:00 (Migrated from github.com)
Review

The workflow references a reusable workflow at version '@v1' that does not yet exist in the MokoStandards repository (as documented in the PR description and MOKOSTANDARDS_MIGRATION.md line 14). This will cause workflow failures until the corresponding reusable workflow is created. While this is documented as a known dependency, consider whether it's appropriate to merge non-functional workflows or if they should wait until the dependency is ready.

    uses: mokoconsulting-tech/MokoStandards/.github/workflows/reusable-ci-validation.yml@main
The workflow references a reusable workflow at version '@v1' that does not yet exist in the MokoStandards repository (as documented in the PR description and MOKOSTANDARDS_MIGRATION.md line 14). This will cause workflow failures until the corresponding reusable workflow is created. While this is documented as a known dependency, consider whether it's appropriate to merge non-functional workflows or if they should wait until the dependency is ready. ```suggestion uses: mokoconsulting-tech/MokoStandards/.github/workflows/reusable-ci-validation.yml@main ```
phpcs:
name: PHP_CodeSniffer - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, json, zip
coverage: none
tools: cs2pr
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-phpcs-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpcs-${{ matrix.php-version }}-
- name: Install PHP_CodeSniffer
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global require "squizlabs/php_codesniffer:^3.0" --with-all-dependencies
composer global require "phpcompatibility/php-compatibility:^9.0" --with-all-dependencies
# Register PHPCompatibility standard
phpcs --config-set installed_paths ~/.composer/vendor/phpcompatibility/php-compatibility
- name: Run PHP_CodeSniffer
run: |
phpcs --standard=phpcs.xml --report=checkstyle | cs2pr
continue-on-error: true
- name: PHPCS Summary
if: always()
run: |
{
echo "### PHP_CodeSniffer Results"
echo ""
echo "- PHP Version: ${{ matrix.php-version }}"
echo "- Standard: PSR-12 with Joomla rules"
echo ""
phpcs --standard=phpcs.xml --report=summary || true
} >> "$GITHUB_STEP_SUMMARY"
phpstan:
name: PHPStan - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, json, zip
coverage: none
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-phpstan-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpstan-${{ matrix.php-version }}-
- name: Install PHPStan
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global config --no-plugins allow-plugins.phpstan/extension-installer true
composer global require phpstan/phpstan "^1.0" --with-all-dependencies
composer global require phpstan/extension-installer "^1.0" --with-all-dependencies
- name: Run PHPStan
run: |
phpstan analyse --configuration=phpstan.neon --error-format=github --no-progress
continue-on-error: true
- name: PHPStan Summary
if: always()
run: |
{
echo "### PHPStan Results"
echo ""
echo "- PHP Version: ${{ matrix.php-version }}"
echo "- Analysis Level: 5"
echo ""
phpstan analyse --configuration=phpstan.neon --no-progress || true
} >> "$GITHUB_STEP_SUMMARY"
php-compatibility:
name: PHP Compatibility Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, xml, ctype, json, zip
coverage: none
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-phpcompat-8.3-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpcompat-8.3-
- name: Install dependencies
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global require "squizlabs/php_codesniffer:^3.0" --with-all-dependencies
composer global require "phpcompatibility/php-compatibility:^9.0" --with-all-dependencies
phpcs --config-set installed_paths ~/.composer/vendor/phpcompatibility/php-compatibility
- name: Check PHP 8.0+ Compatibility
run: |
phpcs --standard=PHPCompatibility --runtime-set testVersion 8.0- src/
continue-on-error: true
- name: Compatibility Summary
if: always()
run: |
{
echo "### PHP Compatibility Check Results"
echo ""
echo "- Target: PHP 8.0+"
echo "- Status: Check completed"
echo ""
echo "See job logs for detailed compatibility issues."
} >> "$GITHUB_STEP_SUMMARY"
# Joomla Integration Testing
joomla-setup:
name: Joomla ${{ matrix.joomla-version }} - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
joomla-version: ['4.4', '5.0', '5.1']
exclude:
# Joomla 4.4 doesn't support PHP 8.3
- php-version: '8.3'
joomla-version: '4.4'
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: joomla_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, json, zip, mysqli, pdo, pdo_mysql, gd, curl, openssl, fileinfo
coverage: none
tools: composer:v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Cache Joomla Downloads
uses: actions/cache@v4
with:
path: /tmp/joomla-cache
key: joomla-${{ matrix.joomla-version }}
restore-keys: |
joomla-${{ matrix.joomla-version }}
- name: Download Joomla ${{ matrix.joomla-version }}
run: |
mkdir -p /tmp/joomla
mkdir -p /tmp/joomla-cache
# Define ZIP file based on version
if [ "${{ matrix.joomla-version }}" = "4.4" ]; then
ZIP_FILE="Joomla_4-4-9-Stable-Full_Package.zip"
ZIP_URL="https://downloads.joomla.org/cms/joomla4/4-4-9/${ZIP_FILE}"
elif [ "${{ matrix.joomla-version }}" = "5.0" ]; then
ZIP_FILE="Joomla_5-0-3-Stable-Full_Package.zip"
ZIP_URL="https://downloads.joomla.org/cms/joomla5/5-0-3/${ZIP_FILE}"
else
ZIP_FILE="Joomla_5-1-4-Stable-Full_Package.zip"
ZIP_URL="https://downloads.joomla.org/cms/joomla5/5-1-4/${ZIP_FILE}"
fi
# Use cached ZIP if available, otherwise download
if [ -f "/tmp/joomla-cache/${ZIP_FILE}" ]; then
echo "Using cached Joomla package: ${ZIP_FILE}"
cp "/tmp/joomla-cache/${ZIP_FILE}" "/tmp/joomla/"
else
echo "Downloading Joomla package: ${ZIP_FILE}"
wget -q "${ZIP_URL}" -O "/tmp/joomla/${ZIP_FILE}"
cp "/tmp/joomla/${ZIP_FILE}" "/tmp/joomla-cache/"
fi
cd /tmp/joomla
unzip -q "${ZIP_FILE}"
- name: Configure Joomla
run: |
cd /tmp/joomla
# Create configuration.php
cat > configuration.php << 'EOF'
<?php
class JConfig {
public $offline = '0';
public $offline_message = 'This site is down for maintenance.<br>Please check back again soon.';
public $display_offline_message = '1';
public $offline_image = '';
public $sitename = 'Joomla Test Site';
public $editor = 'tinymce';
public $captcha = '0';
public $list_limit = '20';
public $access = '1';
public $debug = '0';
public $debug_lang = '0';
public $debug_lang_const = '1';
public $dbtype = 'mysqli';
public $host = '127.0.0.1';
public $user = 'root';
public $password = 'root';
public $db = 'joomla_test';
public $dbprefix = 'jos_';
public $dbencryption = 0;
public $dbsslverifyservercert = false;
public $dbsslkey = '';
public $dbsslcert = '';
public $dbsslca = '';
public $dbsslcipher = '';
public $force_ssl = 0;
public $live_site = '';
public $secret = 'testSecretKey123';
public $gzip = '0';
public $error_reporting = 'default';
public $helpurl = 'https://help.joomla.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode}';
public $offset = 'UTC';
public $mailonline = '1';
public $mailer = 'mail';
public $mailfrom = 'test@example.com';
public $fromname = 'Joomla Test';
public $sendmail = '/usr/sbin/sendmail';
public $smtpauth = '0';
public $smtpuser = '';
public $smtppass = '';
public $smtphost = 'localhost';
public $smtpsecure = 'none';
public $smtpport = '25';
public $caching = '0';
public $cache_handler = 'file';
public $cachetime = '15';
public $cache_platformprefix = '0';
public $MetaDesc = '';
public $MetaAuthor = '1';
public $MetaVersion = '0';
public $robots = '';
public $sef = '1';
public $sef_rewrite = '0';
public $sef_suffix = '0';
public $unicodeslugs = '0';
public $feed_limit = '10';
public $feed_email = 'none';
public $log_path = '/tmp/joomla/administrator/logs';
public $tmp_path = '/tmp/joomla/tmp';
public $lifetime = '15';
public $session_handler = 'database';
public $shared_session = '0';
public $session_metadata = true;
}
EOF
- name: Install Joomla database
run: |
mysql -h 127.0.0.1 -uroot -proot joomla_test < /tmp/joomla/installation/sql/mysql/base.sql || true
mysql -h 127.0.0.1 -uroot -proot joomla_test < /tmp/joomla/installation/sql/mysql/extensions.sql || true
mysql -h 127.0.0.1 -uroot -proot joomla_test < /tmp/joomla/installation/sql/mysql/supports.sql || true
- name: Install template into Joomla
run: |
# Copy template files to Joomla
mkdir -p /tmp/joomla/templates/moko-cassiopeia
cp -r src/templates/* /tmp/joomla/templates/moko-cassiopeia/ || true
# Copy media files
mkdir -p /tmp/joomla/media/templates/site/moko-cassiopeia
cp -r src/media/* /tmp/joomla/media/templates/site/moko-cassiopeia/ || true
# Copy language files
mkdir -p /tmp/joomla/language/en-GB
cp src/language/en-GB/*.ini /tmp/joomla/language/en-GB/ || true
mkdir -p /tmp/joomla/administrator/language/en-GB
cp src/administrator/language/en-GB/*.ini /tmp/joomla/administrator/language/en-GB/ || true
- name: Validate template installation
run: |
if [ -f "/tmp/joomla/templates/moko-cassiopeia/templateDetails.xml" ]; then
echo "✓ Template installed successfully"
php -l /tmp/joomla/templates/moko-cassiopeia/index.php
else
echo "✗ Template installation failed"
exit 1
fi
- name: Test Summary
if: always()
run: |
{
echo "### Joomla ${{ matrix.joomla-version }} Testing with PHP ${{ matrix.php-version }}"
echo ""
echo "- Joomla Version: ${{ matrix.joomla-version }}"
echo "- PHP Version: ${{ matrix.php-version }}"
echo "- MySQL Version: 8.0"
echo ""
echo "✓ Joomla installation completed"
echo "✓ Template files copied"
echo "✓ Template validated"
} >> "$GITHUB_STEP_SUMMARY"
codeception:
name: Codeception Tests
runs-on: ubuntu-latest
needs: joomla-setup
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, xml, ctype, json, zip, mysqli, pdo, pdo_mysql
coverage: xdebug
tools: composer:v2
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-codeception-8.1-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-codeception-8.1-
- name: Install Codeception
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global require codeception/codeception
composer global require codeception/module-db
composer global require codeception/module-asserts
- name: Create test structure
run: |
mkdir -p tests/_output
mkdir -p tests/_data
mkdir -p tests/_support
- name: Run Codeception bootstrap
run: |
codecept bootstrap || echo "Bootstrap skipped - structure exists"
- name: Codeception Summary
run: |
{
echo "### Codeception Test Framework"
echo ""
echo "- Framework: Codeception"
echo "- Status: Ready for test implementation"
echo ""
echo "Note: Test suites should be implemented in future iterations."
} >> "$GITHUB_STEP_SUMMARY"

View File

@@ -1,270 +0,0 @@
name: Joomla Testing
on:
push:
branches:
- main
- dev/**
- rc/**
pull_request:
branches:
- main
- dev/**
- rc/**
permissions:
contents: read
jobs:
joomla-setup:
name: Joomla ${{ matrix.joomla-version }} - PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
joomla-version: ['4.4', '5.0', '5.1']
exclude:
# Joomla 4.4 doesn't support PHP 8.3
- php-version: '8.3'
joomla-version: '4.4'
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: joomla_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, json, zip, mysqli, pdo, pdo_mysql, gd, curl, openssl, fileinfo
coverage: none
tools: composer:v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Cache Joomla Downloads
uses: actions/cache@v4
with:
path: /tmp/joomla-cache
key: joomla-${{ matrix.joomla-version }}
restore-keys: |
joomla-${{ matrix.joomla-version }}
- name: Download Joomla ${{ matrix.joomla-version }}
run: |
mkdir -p /tmp/joomla
mkdir -p /tmp/joomla-cache
# Define ZIP file based on version
if [ "${{ matrix.joomla-version }}" = "4.4" ]; then
ZIP_FILE="Joomla_4-4-9-Stable-Full_Package.zip"
ZIP_URL="https://downloads.joomla.org/cms/joomla4/4-4-9/${ZIP_FILE}"
elif [ "${{ matrix.joomla-version }}" = "5.0" ]; then
ZIP_FILE="Joomla_5-0-3-Stable-Full_Package.zip"
ZIP_URL="https://downloads.joomla.org/cms/joomla5/5-0-3/${ZIP_FILE}"
else
ZIP_FILE="Joomla_5-1-4-Stable-Full_Package.zip"
ZIP_URL="https://downloads.joomla.org/cms/joomla5/5-1-4/${ZIP_FILE}"
fi
# Use cached ZIP if available, otherwise download
if [ -f "/tmp/joomla-cache/${ZIP_FILE}" ]; then
echo "Using cached Joomla package: ${ZIP_FILE}"
cp "/tmp/joomla-cache/${ZIP_FILE}" "/tmp/joomla/"
else
echo "Downloading Joomla package: ${ZIP_FILE}"
wget -q "${ZIP_URL}" -O "/tmp/joomla/${ZIP_FILE}"
cp "/tmp/joomla/${ZIP_FILE}" "/tmp/joomla-cache/"
fi
cd /tmp/joomla
unzip -q "${ZIP_FILE}"
- name: Configure Joomla
run: |
cd /tmp/joomla
# Create configuration.php
cat > configuration.php << 'EOF'
<?php
class JConfig {
public $offline = '0';
public $offline_message = 'This site is down for maintenance.<br>Please check back again soon.';
public $display_offline_message = '1';
public $offline_image = '';
public $sitename = 'Joomla Test Site';
public $editor = 'tinymce';
public $captcha = '0';
public $list_limit = '20';
public $access = '1';
public $debug = '0';
public $debug_lang = '0';
public $debug_lang_const = '1';
public $dbtype = 'mysqli';
public $host = '127.0.0.1';
public $user = 'root';
public $password = 'root';
public $db = 'joomla_test';
public $dbprefix = 'jos_';
public $dbencryption = 0;
public $dbsslverifyservercert = false;
public $dbsslkey = '';
public $dbsslcert = '';
public $dbsslca = '';
public $dbsslcipher = '';
public $force_ssl = 0;
public $live_site = '';
public $secret = 'testSecretKey123';
public $gzip = '0';
public $error_reporting = 'default';
public $helpurl = 'https://help.joomla.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode}';
public $offset = 'UTC';
public $mailonline = '1';
public $mailer = 'mail';
public $mailfrom = 'test@example.com';
public $fromname = 'Joomla Test';
public $sendmail = '/usr/sbin/sendmail';
public $smtpauth = '0';
public $smtpuser = '';
public $smtppass = '';
public $smtphost = 'localhost';
public $smtpsecure = 'none';
public $smtpport = '25';
public $caching = '0';
public $cache_handler = 'file';
public $cachetime = '15';
public $cache_platformprefix = '0';
public $MetaDesc = '';
public $MetaAuthor = '1';
public $MetaVersion = '0';
public $robots = '';
public $sef = '1';
public $sef_rewrite = '0';
public $sef_suffix = '0';
public $unicodeslugs = '0';
public $feed_limit = '10';
public $feed_email = 'none';
public $log_path = '/tmp/joomla/administrator/logs';
public $tmp_path = '/tmp/joomla/tmp';
public $lifetime = '15';
public $session_handler = 'database';
public $shared_session = '0';
public $session_metadata = true;
}
EOF
- name: Install Joomla database
run: |
mysql -h 127.0.0.1 -uroot -proot joomla_test < /tmp/joomla/installation/sql/mysql/base.sql || true
mysql -h 127.0.0.1 -uroot -proot joomla_test < /tmp/joomla/installation/sql/mysql/extensions.sql || true
mysql -h 127.0.0.1 -uroot -proot joomla_test < /tmp/joomla/installation/sql/mysql/supports.sql || true
- name: Install template into Joomla
run: |
# Copy template files to Joomla
mkdir -p /tmp/joomla/templates/moko-cassiopeia
cp -r src/templates/* /tmp/joomla/templates/moko-cassiopeia/ || true
# Copy media files
mkdir -p /tmp/joomla/media/templates/site/moko-cassiopeia
cp -r src/media/* /tmp/joomla/media/templates/site/moko-cassiopeia/ || true
# Copy language files
mkdir -p /tmp/joomla/language/en-GB
cp src/language/en-GB/*.ini /tmp/joomla/language/en-GB/ || true
mkdir -p /tmp/joomla/administrator/language/en-GB
cp src/administrator/language/en-GB/*.ini /tmp/joomla/administrator/language/en-GB/ || true
- name: Validate template installation
run: |
if [ -f "/tmp/joomla/templates/moko-cassiopeia/templateDetails.xml" ]; then
echo "✓ Template installed successfully"
php -l /tmp/joomla/templates/moko-cassiopeia/index.php
else
echo "✗ Template installation failed"
exit 1
fi
- name: Test Summary
if: always()
run: |
{
echo "### Joomla ${{ matrix.joomla-version }} Testing with PHP ${{ matrix.php-version }}"
echo ""
echo "- Joomla Version: ${{ matrix.joomla-version }}"
echo "- PHP Version: ${{ matrix.php-version }}"
echo "- MySQL Version: 8.0"
echo ""
echo "✓ Joomla installation completed"
echo "✓ Template files copied"
echo "✓ Template validated"
} >> "$GITHUB_STEP_SUMMARY"
codeception:
name: Codeception Tests
runs-on: ubuntu-latest
needs: joomla-setup
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, xml, ctype, json, zip, mysqli, pdo, pdo_mysql
coverage: xdebug
tools: composer:v2
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-codeception-8.1-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-codeception-8.1-
- name: Install Codeception
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global require codeception/codeception
composer global require codeception/module-db
composer global require codeception/module-asserts
- name: Create test structure
run: |
mkdir -p tests/_output
mkdir -p tests/_data
mkdir -p tests/_support
- name: Run Codeception bootstrap
run: |
codecept bootstrap || echo "Bootstrap skipped - structure exists"
- name: Codeception Summary
run: |
{
echo "### Codeception Test Framework"
echo ""
echo "- Framework: Codeception"
echo "- Status: Ready for test implementation"
echo ""
echo "Note: Test suites should be implemented in future iterations."
} >> "$GITHUB_STEP_SUMMARY"

View File

@@ -1,174 +0,0 @@
name: PHP Code Quality
on:
push:
branches:
- main
- dev/**
- rc/**
- version/**
pull_request:
branches:
- main
- dev/**
- rc/**
- version/**
permissions:
contents: read
jobs:
phpcs:
name: PHP_CodeSniffer
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, json, zip
coverage: none
tools: cs2pr
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-phpcs-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpcs-${{ matrix.php-version }}-
- name: Install PHP_CodeSniffer
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global require "squizlabs/php_codesniffer:^3.0" --with-all-dependencies
composer global require "phpcompatibility/php-compatibility:^9.0" --with-all-dependencies
# Register PHPCompatibility standard
phpcs --config-set installed_paths ~/.composer/vendor/phpcompatibility/php-compatibility
- name: Run PHP_CodeSniffer
run: |
phpcs --standard=phpcs.xml --report=checkstyle | cs2pr
continue-on-error: true
- name: PHPCS Summary
if: always()
run: |
{
echo "### PHP_CodeSniffer Results"
echo ""
echo "- PHP Version: ${{ matrix.php-version }}"
echo "- Standard: PSR-12 with Joomla rules"
echo ""
phpcs --standard=phpcs.xml --report=summary || true
} >> "$GITHUB_STEP_SUMMARY"
phpstan:
name: PHPStan Static Analysis
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, json, zip
coverage: none
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-phpstan-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpstan-${{ matrix.php-version }}-
- name: Install PHPStan
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global config --no-plugins allow-plugins.phpstan/extension-installer true
composer global require phpstan/phpstan "^1.0" --with-all-dependencies
composer global require phpstan/extension-installer "^1.0" --with-all-dependencies
- name: Run PHPStan
run: |
phpstan analyse --configuration=phpstan.neon --error-format=github --no-progress
continue-on-error: true
- name: PHPStan Summary
if: always()
run: |
{
echo "### PHPStan Results"
echo ""
echo "- PHP Version: ${{ matrix.php-version }}"
echo "- Analysis Level: 5"
echo ""
phpstan analyse --configuration=phpstan.neon --no-progress || true
} >> "$GITHUB_STEP_SUMMARY"
php-compatibility:
name: PHP Compatibility Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, xml, ctype, json, zip
coverage: none
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer
key: ${{ runner.os }}-composer-phpcompat-8.3-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpcompat-8.3-
- name: Install dependencies
env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
run: |
composer global require "squizlabs/php_codesniffer:^3.0" --with-all-dependencies
composer global require "phpcompatibility/php-compatibility:^9.0" --with-all-dependencies
phpcs --config-set installed_paths ~/.composer/vendor/phpcompatibility/php-compatibility
- name: Check PHP 8.0+ Compatibility
run: |
phpcs --standard=PHPCompatibility --runtime-set testVersion 8.0- src/
continue-on-error: true
- name: Compatibility Summary
if: always()
run: |
{
echo "### PHP Compatibility Check Results"
echo ""
echo "- Target: PHP 8.0+"
echo "- Status: Check completed"
echo ""
echo "See job logs for detailed compatibility issues."
} >> "$GITHUB_STEP_SUMMARY"