Skip to content

Commit 6c5424a

Browse files
authored
Support changing the PHP version (#75)
1 parent 8502d7f commit 6c5424a

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/test-complex.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ jobs:
2525
https://downloads.wordpress.org/plugin/wordpress-seo.zip
2626
iterations: 5
2727
repetitions: 1
28-
wpVersion: 'trunk'
28+
wp-version: 'trunk'
29+
php-version: '7.4'

action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ inputs:
3232
required: false
3333
description: 'WordPress version to use.'
3434
default: 'latest'
35+
php-version:
36+
required: false
37+
description: 'PHP version to use.'
38+
default: 'auto'
3539
shard:
3640
required: false
3741
description: 'Shard to use if running tests in parallel in a matrix.'
@@ -146,13 +150,20 @@ runs:
146150
WP_VERSION="\"WordPress/WordPress#$WP_VERSION\""
147151
fi
148152
153+
if [[ $PHP_VERSION == 'auto' ]]; then
154+
PHP_VERSION=null
155+
else
156+
PHP_VERSION="\"$PHP_VERSION\""
157+
fi
158+
149159
jq -n \
150160
--argjson wp "$WP_VERSION" \
161+
--argjson php "$PHP_VERSION" \
151162
--arg rp "$REQUIRED_PLUGINS" \
152163
--arg p "$PLUGINS" \
153164
--arg t "$THEMES" \
154165
--arg rt "$REQUIRED_THEMES" \
155-
'{core: $wp, plugins: [($rp | split("\n")), ($p | split("\n"))] | add, themes: [($rt | split("\n")), ($t | split("\n"))] | add}' \
166+
'{core: $wp, phpVersion: $php, plugins: [($rp | split("\n")), ($p | split("\n"))] | add, themes: [($rt | split("\n")), ($t | split("\n"))] | add}' \
156167
> ${{ env.PERF_ACTION_PATH }}/env/.wp-env.override.json
157168
158169
cat ${{ env.PERF_ACTION_PATH }}/env/.wp-env.override.json
@@ -161,6 +172,7 @@ runs:
161172
PLUGINS: ${{ inputs.plugins }}
162173
THEMES: ${{ inputs.themes }}
163174
WP_VERSION: ${{ inputs.wp-version }}
175+
PHP_VERSION: ${{ inputs.php-version }}
164176
shell: 'bash'
165177

166178
- name: Start WordPress

0 commit comments

Comments
 (0)