Skip to content

Commit

Permalink
Add wp-version input (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Feb 14, 2024
1 parent 842df18 commit e2d7d70
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
mkdir build/
mv hello.php build/
- name: Run plugin check
- name: Run plugin check (default)
uses: ./
continue-on-error: true # Since we expect it to always fail for the test plugin.
with:
build-dir: 'build'

- name: Run plugin check
- name: Run plugin check (exclude checks)
uses: ./
continue-on-error: true # Since we expect it to always fail for the test plugin.
with:
Expand All @@ -33,3 +33,10 @@ jobs:
late_escaping
plugin_readme
include-experimental: true

- name: Run plugin check (trunk)
uses: ./
continue-on-error: true # Since we expect it to always fail for the test plugin.
with:
build-dir: 'build'
wp-version: 'trunk'
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ See [action.yml](action.yml)
#
# Default: true
include-experimental: ''

# WordPress version to use. Supports "latest" or "trunk".
#
# Default: latest
wp-version: ''
```
### Basic
Expand Down
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ inputs:
description: 'Include experimental checks'
required: false
default: 'false'
wp-version:
description: 'WordPress version to use'
required: false
default: 'latest'
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -84,11 +88,13 @@ runs:
run: |
touch .wp-env.json
> .wp-env.json
echo "{ \"core\": null, \"port\": 8880, \"testsPort\": 8881, \"plugins\": [ \"$PLUGIN_DIR\", \"plugin-check\" ] }" >> .wp-env.json
echo "{ \"core\": $WP_VERSION, \"port\": 8880, \"testsPort\": 8881, \"plugins\": [ \"$PLUGIN_DIR\", \"https://downloads.wordpress.org/plugin/plugin-check.1.0.0.zip\" ] }" >> .wp-env.json
npm -g i @wordpress/env
npm -g --no-fund i @wordpress/env
wp-env start --update
shell: bash
env:
WP_VERSION: ${{ inputs.wp-version == 'trunk' && '"WordPress/WordPress#master"' || 'null' }}

- name: Run Plugin Check
run: |
Expand Down

0 comments on commit e2d7d70

Please sign in to comment.