Skip to content

Commit

Permalink
Allow coding standards testing against different WordPress versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Apr 21, 2024
1 parent 71244fd commit 0e46355
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/reusable-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ name: Coding Standards
on:
workflow_call:
inputs:
wp:
required: false
default: latest
type: string
description: WordPress version to use in major.minor format (e.g. 6.4), or "latest" or "nightly"
php:
required: true
type: string
description: PHP version to use in major.minor format (e.g. 8.0)

jobs:
test:
name: PHP / PHP ${{ inputs.php }}
name: WP ${{ inputs.wp }} / PHP ${{ inputs.php }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -61,7 +66,14 @@ jobs:
run: composer validate --strict --no-check-lock

- name: Install dependencies
run: composer install --prefer-dist
run: |
if [ "${{ inputs.wp }}" == "latest" ]; then
composer install --dev --prefer-dist
elif [ "${{ inputs.wp }}" == "nightly" ]; then
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress-full="dev-main"
else
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress-full="~${{ inputs.wp }}.0" php-stubs/wordpress-stubs="~${{ inputs.wp }}.0"
fi
- name: Run static analysis
run: composer test:phpstan
Expand Down

0 comments on commit 0e46355

Please sign in to comment.