Skip to content

Commit

Permalink
Allow for PHP 5.6 and 7.0 in old branches to run tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
desrosj committed May 7, 2024
1 parent 5731a41 commit 778f3b9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/callable-phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ on:
required: false
type: 'string'
default: ''
legacy-phpunit:
description: 'Whether to install phpunit/phpunit for PHP 5.6 & 7.0 in old branches'
required: false
type: 'boolean'
default: false
tests-domain:
description: 'The domain to use for the tests'
required: false
Expand Down Expand Up @@ -128,11 +133,19 @@ jobs:
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
if: ${{ ! inputs.legacy-phpunit }}
with:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
composer-options: ${{ inputs.composer-options }}
dependency-versions: ${{ inputs.composer-dependency-versions }}

# For some old WordPress branches, a specific version of PHPunit is required.
- name: Install Composer dependencies (old branches)
if: ${{ inputs.legacy-phpunit }}
run: |
composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies
git checkout -- composer.lock composer.json
- name: Install npm dependencies
run: npm ci

Expand Down

0 comments on commit 778f3b9

Please sign in to comment.