Skip to content

Commit

Permalink
Merge branch 'phpcs'
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh committed Jun 25, 2024
2 parents ea0acd7 + d284a14 commit 1e17940
Show file tree
Hide file tree
Showing 8 changed files with 1,888 additions and 441 deletions.
2 changes: 2 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ codeception.dist.yml
.env
.env.testing
.prettierignore
phpcs.xml.dist
phpcs.xml
47 changes: 47 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: PHP Compatibility

on:
workflow_dispatch:
push:
paths:
- '**.php'

jobs:
php-compatibility:
name: PHP ${{ matrix.php-version }} Compatibility
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3"]

env:
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}'

steps:
- uses: actions/checkout@v4

- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl
coverage: none

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: ramsey/composer-install@v3
with:
dependency-versions: highest

- name: Run PHP Compatibility
run: composer compatibility:php-${{ matrix.php-version }}
39 changes: 28 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "7.2.34"
"php": "7.4"
},
"allow-plugins": {
"composer/installers": true
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"repositories": [
Expand All @@ -35,24 +36,27 @@
],
"require": {
"composer/installers": "^2.0",
"psr/container": "^1.0",
"lucatume/di52": "^3.3",
"stellarwp/telemetry": "^2.3",
"stellarwp/uplink": "dev-bugfix/multisite-token-logic",
"psr/container": "^1.0",
"stellarwp/container-contract": "^1.0",
"stellarwp/prophecy-image-downloader": "^1.5",
"stellarwp/prophecy-storage": "^1.1",
"stellarwp/telemetry": "^2.3",
"stellarwp/uplink": "dev-bugfix/multisite-token-logic",
"symfony/translation-contracts": "^2.5"
},
"require-dev": {
"lucatume/wp-browser": "<3.5",
"automattic/vipwpcs": "^3.0",
"codeception/module-asserts": "^1.3.1",
"codeception/module-phpbrowser": "^1.0.3",
"codeception/module-webdriver": "^1.4.1",
"codeception/module-cli": "^1.1.1",
"codeception/module-db": "^1.2",
"codeception/module-filesystem": "^1.0.3",
"codeception/module-cli": "^1.1.1",
"codeception/util-universalframework": "^1.0"
"codeception/module-phpbrowser": "^1.0.3",
"codeception/module-webdriver": "^1.4.1",
"codeception/util-universalframework": "^1.0",
"lucatume/wp-browser": "<3.5",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"stellarwp/coding-standards": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -98,7 +102,20 @@
],
"post-update-cmd": [
"@strauss"
]
],
"compatibility:php-7.4": "phpcs -d memory_limit=2048M -p -s --standard=PHPCompatibilityWP --runtime-set testVersion 7.4 --ignore=./vendor,./node_modules,./dist,./src/packages/icons/,./includes/assets/ --extensions=php ./",
"compatibility:php-8.0": "phpcs -d memory_limit=2048M -p -s --standard=PHPCompatibilityWP --runtime-set testVersion 8.0 --ignore=./vendor,./node_modules,./dist,./src/packages/icons/,./includes/assets/ --extensions=php ./",
"compatibility:php-8.1": "phpcs -d memory_limit=2048M -p -s --standard=PHPCompatibilityWP --runtime-set testVersion 8.1 --ignore=./vendor,./node_modules,./dist,./src/packages/icons/,./includes/assets/ --extensions=php ./",
"compatibility:php-8.2": "phpcs -d memory_limit=2048M -p -s --standard=PHPCompatibilityWP --runtime-set testVersion 8.2 --ignore=./vendor,./node_modules,./dist,./src/packages/icons/,./includes/assets/ --extensions=php ./",
"compatibility:php-8.3": "phpcs -d memory_limit=2048M -p -s --standard=PHPCompatibilityWP --runtime-set testVersion 8.3 --ignore=./vendor,./node_modules,./dist,./src/packages/icons/,./includes/assets/ --extensions=php ./",
"compatibility": [
"@compatibility:php-7.4",
"@compatibility:php-8.0",
"@compatibility:php-8.1",
"@compatibility:php-8.2",
"@compatibility:php-8.3"
],
"phpcs": "phpcs --standard=phpcs.xml"
},
"extra": {
"strauss": {
Expand Down
Loading

0 comments on commit 1e17940

Please sign in to comment.