File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Plugin Check
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - develop
8+ - trunk
9+ pull_request :
10+ types :
11+ - opened
12+ - synchronize
13+ - ready_for_review
14+
15+ # Cancels all previous workflow runs for pull requests that have not completed.
16+ concurrency :
17+ # The concurrency group contains the workflow name and the branch name for pull requests
18+ # or the commit hash for any other events.
19+ group : ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
20+ cancel-in-progress : true
21+
22+ # Disable permissions for all available scopes by default.
23+ # Any needed permissions should be configured at the job level.
24+ permissions : {}
25+
26+ jobs :
27+ plugin-check :
28+ name : PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}
29+ runs-on : ' ubuntu-24.04'
30+ permissions :
31+ contents : read
32+ timeout-minutes : 20
33+ strategy :
34+ fail-fast : true
35+ matrix :
36+ php :
37+ - ' 8.3' # Currently the wordpress/plugin-check-action always uses the latest PHP version anyway.
38+ wordpress : ['latest'] # Currently the wordpress/plugin-check-action only supports 'latest' or 'trunk'.
39+ steps :
40+ - uses : actions/checkout@v4
41+
42+ - uses : shivammathur/setup-php@v2
43+ with :
44+ php-version : ${{ matrix.php }}
45+
46+ - name : Install Composer dependencies
47+ run : composer install
48+
49+ - name : Setup Node.js (.nvmrc)
50+ uses : actions/setup-node@v4
51+ with :
52+ node-version-file : ' .nvmrc'
53+ cache : npm
54+
55+ - name : npm install
56+ run : npm ci
57+
58+ - name : Build assets
59+ run : npm run build
60+
61+ - name : Run plugin check
62+ uses : wordpress/plugin-check-action@v1
63+ with :
64+ wp-version : ${{ matrix.wordpress }}
65+ # Exclude file_type because of the dev files present in the repository.
66+ exclude-checks : |
67+ file_type
68+ exclude-directories : |
69+ .github
70+ docs
71+ tests
Original file line number Diff line number Diff line change 2020 "ext-gd" : " Required to use Modern Image Format's Dominant_Color_Image_Editor_GD class" ,
2121 "ext-zlib" : " Required for compression of URL Metric data submitted to the REST API for storage in Optimization Detective"
2222 },
23- "repositories" :[
24- {
25- "type" :" composer" ,
26- "url" :" https://wpackagist.org" ,
27- "only" : [
28- " wpackagist-plugin/*" ,
29- " wpackagist-theme/*"
30- ]
31- }
32- ],
3323 "extra" : {
34- "installer-paths" : {
35- "vendor/{$vendor}/{$name}/" : [
36- " wpackagist-plugin/plugin-check"
37- ]
38- }
3924 },
4025 "require-dev" : {
4126 "phpcompatibility/php-compatibility" : " ^9.3" ,
5035 "wp-phpunit/wp-phpunit" : " ^6.5" ,
5136 "yoast/phpunit-polyfills" : " ^4.0" ,
5237 "phpstan/php-8-stubs" : " ^0.4.0" ,
53- "phpstan/phpstan-strict-rules" : " ^1.6" ,
54- "wpackagist-plugin/plugin-check" : " ^1.6"
38+ "phpstan/phpstan-strict-rules" : " ^1.6"
5539 },
5640 "config" : {
5741 "allow-plugins" : {
Original file line number Diff line number Diff line change 22<ruleset name =" WPP-Base" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd" >
33 <description >Sniffs for WordPress plugins</description >
44
5- <rule ref =" ../../vendor/wpackagist-plugin/plugin-check/vendor/plugin-check/phpcs-sniffs/PluginCheck/ruleset.xml" />
6- <rule ref =" ../../vendor/wpackagist-plugin/plugin-check/phpcs-rulesets/plugin-check.ruleset.xml" />
7-
85 <rule ref =" PHPCompatibility" />
96 <config name =" testVersion" value =" 7.2-" />
107
7370 <exclude-pattern >./plugins/*/tests/**</exclude-pattern >
7471 </rule >
7572
73+ <rule ref =" WordPress.Files.FileName.NotHyphenatedLowercase" >
74+ <exclude-pattern >plugins/performance-lab/includes/server-timing/object-cache.copy.php</exclude-pattern >
75+ </rule >
76+
7677 <!-- Exceptions for variable name casing. -->
7778 <rule ref =" WordPress.NamingConventions.ValidVariableName" >
7879 <properties >
122123 <exclude name =" SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" /><!-- TODO: Investigate this -->
123124 </rule >
124125
125- <rule ref =" PluginCheck.CodeAnalysis.Offloading.OffloadedContent" >
126- <exclude-pattern >./plugins/*/tests/**</exclude-pattern >
127- </rule >
128126 <rule ref =" Squiz.PHP.DiscouragedFunctions.Discouraged" >
129127 <exclude-pattern >./plugins/*/tests/**</exclude-pattern >
130128 </rule >
You can’t perform that action at this time.
0 commit comments