ci: standardize PHP matrix to 8.1/8.2/8.3
This commit is contained in:
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
php: ['7.4', '8.1', '8.3']
|
php: ['8.1', '8.2', '8.3']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup PHP ${{ matrix.php }}
|
- name: Setup PHP ${{ matrix.php }}
|
||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
coverage: none
|
coverage: none
|
||||||
- name: Syntax check all PHP files
|
- name: Syntax check all PHP files
|
||||||
# Exclude .github/mu-plugins — those run on the production server (PHP 8+)
|
# Exclude .github/mu-plugins — those run on the production server (PHP 8+)
|
||||||
# and may use PHP 8+ syntax (union types etc.) that 7.4 rejects.
|
# and may use PHP 8+ syntax (union types etc.) that older versions reject.
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
find . -name '*.php' \
|
find . -name '*.php' \
|
||||||
@@ -44,14 +44,12 @@ jobs:
|
|||||||
phpcs:
|
phpcs:
|
||||||
name: PHPCS (WordPress standards)
|
name: PHPCS (WordPress standards)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: false # now strict after PHPCS cleanup in v0.8.3
|
continue-on-error: false # strict after PHPCS cleanup in v0.8.3
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # allows phpcbf auto-fix commits back to the PR branch
|
contents: write # allows phpcbf auto-fix commits back to the PR branch
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Check out the actual branch so phpcbf can push fixes back.
|
|
||||||
# github.head_ref is set on PR events; github.ref_name on push events.
|
|
||||||
ref: ${{ github.head_ref || github.ref_name }}
|
ref: ${{ github.head_ref || github.ref_name }}
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
@@ -62,10 +60,7 @@ jobs:
|
|||||||
tools: composer:v2, phpcs
|
tools: composer:v2, phpcs
|
||||||
- name: Install WordPress Coding Standards
|
- name: Install WordPress Coding Standards
|
||||||
run: |
|
run: |
|
||||||
# Allow the PHPCS composer-installer plugin (auto-registers standards).
|
|
||||||
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
|
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
|
||||||
# WPCS 3.x requires PHPCSExtra (for the Universal.* and NormalizedArrays.* sniffs)
|
|
||||||
# AND phpcsutils. Installing the installer itself lets it auto-register the standards path.
|
|
||||||
composer global require --no-interaction \
|
composer global require --no-interaction \
|
||||||
"dealerdirect/phpcodesniffer-composer-installer:^1.0" \
|
"dealerdirect/phpcodesniffer-composer-installer:^1.0" \
|
||||||
"wp-coding-standards/wpcs:^3.0" \
|
"wp-coding-standards/wpcs:^3.0" \
|
||||||
@@ -101,7 +96,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
php: ['7.4', '8.1', '8.3']
|
php: ['8.1', '8.2', '8.3']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup PHP ${{ matrix.php }}
|
- name: Setup PHP ${{ matrix.php }}
|
||||||
|
|||||||
Reference in New Issue
Block a user