Skip to content
Merged
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
71 changes: 71 additions & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Plugin Check

on:
workflow_dispatch:
push:
branches:
- develop
- trunk
pull_request:
types:
- opened
- synchronize
- ready_for_review

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
plugin-check:
name: Run Plugin Check
runs-on: 'ubuntu-24.04'
permissions:
contents: read
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
persist-credentials: false

- name: Set up PHP
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
with:
php-version: '8.3'
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1

- name: Setup Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
cache: 'npm'
node-version-file: '.nvmrc'

- name: Install NPM dependencies
run: npm ci

- name: Build assets
run: npm run build

- name: Run plugin check
uses: wordpress/plugin-check-action@ec9b3fe9beaa76bcc4510b7ba2cb5855a5f80f3f # v1.1.4
with:
wp-version: 'latest'
# Exclude file_type because of the dev files present in the repository.
exclude-checks: |
file_type
exclude-directories: |
.github
docs
tests
25 changes: 1 addition & 24 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"require-dev": {
"automattic/vipwpcs": "^3.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"phpcompatibility/php-compatibility": "10.x-dev as 9.99.99",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd assume we'd just be changing this to "^10.0.0-alpha," why remove it entirely?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note there's some discussion about this on #138 but I agree. I wouldn't remove this entirely. I had recommended aliasing on #138 but I think we can also change this to phpcompatibility/php-compatibility:10.0.0-alpha2 as 9.99.99 to fix the problem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK we don't even need the aliasing anymore:

This works just fine for me:

		"phpcompatibility/php-compatibility": "^10.0.0-alpha",
		"phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha",

Copy link
Copy Markdown
Member Author

@felixarntz felixarntz Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I don't think we should do the aliasing, that feels quite hacky. We need to ensure our dependencies are compatible.

Copy link
Copy Markdown
Collaborator

@dkotter dkotter Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is fine by me as well, though noting it's not much different than the aliasing approach we have now (still ends up pulling in dev releases). I think the important piece here that we don't have now is the "phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha", as without that I think the automattic/vipwpcs package will complain

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed this in 0e3d827: We should only need to include "phpcompatibility/phpcompatibility-wp" because we don't use "phpcompatibility/php-compatibility" anywhere explicitly, in other words, it's an indirect dependency - no need to specify it.

By requiring "phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha", "phpcompatibility/php-compatibility": "^10.0.0-alpha" will be installed anyway.

"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^2.0.3",
"phpstan/phpstan-phpunit": "^2.0.3",
Expand All @@ -24,7 +23,6 @@
"szepeviktor/phpstan-wordpress": "^2.0.2",
"wp-coding-standards/wpcs": "^3.2.0",
"wp-phpunit/wp-phpunit": "^6.5",
"wpackagist-plugin/plugin-check": "^1.6",
"yoast/phpunit-polyfills": "^4.0"
},
"autoload": {
Expand Down Expand Up @@ -54,27 +52,6 @@
"php": "7.4"
}
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org",
"only": [
"wpackagist-plugin/*",
"wpackagist-theme/*"
]
},
{
"type": "vcs",
"url": "https://github.com/WordPress/wp-ai-client"
}
],
"extra": {
"installer-paths": {
"vendor/{$vendor}/{$name}/": [
"wpackagist-plugin/plugin-check"
]
}
},
"scripts": {
"format": "phpcbf --standard=phpcs.xml.dist",
"lint": "phpcs --standard=phpcs.xml.dist",
Expand Down
Loading
Loading