Skip to content

Commit df83a2f

Browse files
committed
Update CI
1 parent f509789 commit df83a2f

File tree

2 files changed

+12
-49
lines changed

2 files changed

+12
-49
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: "Setup PHP"
2727
uses: shivammathur/setup-php@v2
2828
with:
29-
php-version: "7.4"
29+
php-version: "8.4"
3030
coverage: none
3131

3232
- name: "Checkout code"
@@ -47,7 +47,7 @@ jobs:
4747
- name: "Setup PHP"
4848
uses: shivammathur/setup-php@v2
4949
with:
50-
php-version: "7.4"
50+
php-version: "8.4"
5151
coverage: none
5252

5353
- name: "Install xmllint"
@@ -97,7 +97,7 @@ jobs:
9797
- name: "Setup PHP"
9898
uses: shivammathur/setup-php@v2
9999
with:
100-
php-version: "7.4"
100+
php-version: "8.4"
101101
coverage: none
102102

103103
- name: "Checkout code"
@@ -119,7 +119,7 @@ jobs:
119119
runs-on: "ubuntu-latest"
120120
strategy:
121121
matrix:
122-
php: [ '7.4', '8.0', '8.1', '8.2' ]
122+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
123123

124124
steps:
125125
- name: "Set up PHP"
@@ -139,6 +139,7 @@ jobs:
139139
- name: "Install Composer dependencies"
140140
uses: ramsey/composer-install@v2
141141
with:
142+
composer-options: --ignore-platform-req=php+
142143
custom-cache-suffix: $(date -u "+%Y-%m")
143144

144145
- name: Lint against parse errors
@@ -155,7 +156,7 @@ jobs:
155156
- name: "Set up PHP"
156157
uses: shivammathur/setup-php@v2
157158
with:
158-
php-version: "7.4"
159+
php-version: "8.4"
159160
coverage: none
160161
tools: phpstan
161162

@@ -171,43 +172,22 @@ jobs:
171172
run: phpstan analyse
172173

173174
tests:
174-
name: "PHP ${{ matrix.php }} with PHPCS ${{ matrix.phpcs_branch }}/WordPressCS ${{ matrix.wpcs_branch }}"
175+
name: "Tests: PHP ${{ matrix.php }}"
175176
needs:
176177
- "composer_validate"
177178
- "ruleset_validate"
178179
runs-on: ubuntu-latest
179-
continue-on-error: ${{ matrix.allowed_failure }}
180180
strategy:
181181
fail-fast: false
182182
matrix:
183-
php: [ '7.4', '8.0', '8.1', '8.2' ]
184-
phpcs_branch: [ 'lowest', 'dev-master' ]
185-
wpcs_branch: [ '3.0.0', 'dev-develop' ]
186-
allowed_failure: [ false ]
187-
exclude:
188-
# Only run low WordPressCS in combination with low PHPCS and high WordPressCS with high PHPCS.
189-
- phpcs_branch: '3.7.2'
190-
wpcs_branch: '3.0.0'
191-
- phpcs_branch: 'dev-master'
192-
wpcs_branch: 'dev-develop'
193-
# Allow failure on non-released version of PHP.
194-
include:
195-
- php: '8.3'
196-
phpcs_branch: 'dev-master'
197-
wpcs_branch: 'dev-develop'
198-
allowed_failure: true
183+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
199184

200185
steps:
201186
# On stable PHPCS versions, allow for PHP deprecation notices.
202187
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
203188
- name: "Setup ini config"
204189
id: set_ini
205-
run: |
206-
if [ "${{ matrix.phpcs_branch }}" != "dev-master" ]; then
207-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
208-
else
209-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
210-
fi
190+
run: echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
211191

212192
# Setup PHP versions, run checks
213193
- name: "Setup PHP"
@@ -220,11 +200,7 @@ jobs:
220200
- name: "Checkout code"
221201
uses: actions/checkout@v4
222202

223-
- name: "Set the minimum stability requirement for develop branch of WordPressCS"
224-
if: ${{ matrix.wpcs_branch == 'dev-develop' }}
225-
run: composer config minimum-stability dev
226-
227-
- name: "Install Composer dependencies (PHP < 8.0 )"
203+
- name: "Install Composer dependencies (PHP < 8.0)"
228204
if: ${{ matrix.php < 8.0 }}
229205
uses: ramsey/composer-install@v2
230206
with:
@@ -237,25 +213,13 @@ jobs:
237213
composer-options: --ignore-platform-req=php+
238214
custom-cache-suffix: $(date -u "+%Y-%m")
239215

240-
- name: "Set the required PHPCS and WordPressCS versions"
241-
if: ${{ matrix.phpcs_branch != 'lowest' }}
242-
env:
243-
PHPCS_BRANCH: ${{ matrix.phpcs_branch }}
244-
WPCS_BRANCH: ${{ matrix.wpcs_branch }}
245-
run: composer require squizlabs/php_codesniffer:${PHPCS_BRANCH} wp-coding-standards/wpcs:${WPCS_BRANCH} --no-update --no-scripts --no-interaction
246-
247-
- name: "Set PHPCS version (lowest)"
248-
if: ${{ matrix.phpcs_version == 'lowest' }}
249-
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
250-
251216
- name: "Test the Eightshift ruleset"
252217
run: composer tests:checkcs
253218

254219
# Test for fixer conflicts by running the auto-fixers of the complete WordPressCS over the test case files.
255220
# This is not an exhaustive test, but should give an early indication for typical fixer conflicts.
256221
# If only fixable errors are found, the exit code will be 1, which can be interpreted as success.
257222
- name: "Test for fixer conflicts (fixes expected)"
258-
if: ${{ matrix.phpcs_branch == 'dev-master' }}
259223
continue-on-error: true
260224
run: |
261225
$(pwd)/vendor/bin/phpcbf -pq ./Eightshift/Tests/ --standard=Eightshift --extensions=inc --exclude=Generic.PHP.Syntax --report=summary

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ _No documentation available about unreleased changes yet._
1616
- Updated dependencies. PHPUnit had a security vulnerability that needed to be addressed. More recent versions of PHPUnit (v10+) introduced breaking changes that would require a major version bump. Priority of this release was to fix the security vulnerability.
1717
- Added exclude to deprecated ruleset since WordPressCS v3.3.0. Covered by PHPCompatibilityWP.
1818
- Renamed tests.
19+
- CI updates.
1920

2021
## [3.0.0](https://github.com/infinum/eightshift-coding-standards/compare/2.0.0...3.0.0)
2122

@@ -186,9 +187,7 @@ We renamed the package from `infinum/coding-standards-wp` to `infinum/eightshift
186187

187188
### Official release of the Eightshift coding standards for WordPress projects
188189

189-
This is the official release of the Eightshift coding standards for WordPress. It contains breaking changes, mostly in
190-
regard
191-
of the naming scheme.
190+
This is the official release of the Eightshift coding standards for WordPress. It contains breaking changes, mostly in regard of the naming scheme.
192191
To equate the way we write our PHP and JS we opted to follow a modified PSR standards.
193192
What this means is that we will remove liberal spacing, add some PSR12 modifications regarding arguments placing in closures, change snake_case with CamelCase for classes (for autoload puropses) and some other minor changes that will be documented below.
194193
If you wish to use the old standards, be sure to modify your projects `composer.json` file with the appropriate version.

0 commit comments

Comments
 (0)