Fix tests to account for pre-WP 6.4. #97
This file contains 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
name: Plugin Check | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- synchronize | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
plugin-check: | |
name: PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: true | |
matrix: | |
php: | |
- '8.3' # Currently the wordpress/plugin-check-action always uses the latest PHP version anyway. | |
wordpress: [ 'latest' ] # Currently the wordpress/plugin-check-action only supports 'latest' or 'trunk'. | |
steps: | |
- uses: styfle/[email protected] | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Composer dependencies | |
run: composer install | |
- name: Prefix relevant dependencies | |
run: composer prefix-dependencies | |
- name: Setup Node.js (.nvmrc) | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: npm install | |
run: npm ci | |
- name: Build assets | |
run: npm run build | |
- name: Run plugin check | |
uses: wordpress/plugin-check-action@v1 | |
with: | |
wp-version: ${{ matrix.wordpress }} | |
# Exclude file_type because of the dev files present in the repository. | |
# Exclude i18n_usage temporarily because of https://github.com/WordPress/plugin-check/issues/713. | |
# Exclude late_escaping because it unnecessarily flags unescaped exceptions in third-party code. | |
exclude-checks: | | |
file_type | |
i18n_usage | |
late_escaping |