-
Notifications
You must be signed in to change notification settings - Fork 88
Use plugin-check GitHub workflow in favor of brittle plugin-check PHPCS checks #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d5efd6b
Stop using plugin-check PHPCS rules due to brittle configuration.
felixarntz 6f9204c
Implement plugin-check as proper GitHub workflow for more comprehensi…
felixarntz e93ae8c
Annotate valid unprefixed hook name due to reuse from Core.
felixarntz 4572643
Merge branch 'develop' into fix/plugin-check
felixarntz 24b253b
Update PHP version.
felixarntz d95d473
Get rid of unnecessary test matrix.
felixarntz 76d957b
Pin 3P action versions.
felixarntz 0cd97bb
Use ramsey/composer-install.
felixarntz 0e3d827
Use alpha of phpcompatibility-wp.
felixarntz 7241431
Pin `plugin-check-action` version.
felixarntz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.99to fix the problemThere was a problem hiding this comment.
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:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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 theautomattic/vipwpcspackage will complainThere was a problem hiding this comment.
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.