Skip to content

Commit

Permalink
NEW Install extra PHP extensions for some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jul 9, 2024
1 parent add97c1 commit 6a8176b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
steps:
- name: Generate matrix
id: generate-matrix
uses: silverstripe/gha-generate-matrix@v1
uses: creative-commoners/gha-generate-matrix@pulls/1/in-memory-cache
with:
composer_install: ${{ inputs.composer_install }}
extra_jobs: ${{ inputs.extra_jobs }}
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: curl, dom, gd, intl, json, ldap, mbstring, mysql, tidy, xdebug, zip
tools: composer:v2
tools: composer:v2, pecl
coverage: xdebug
# While this should be the correct way to allow forks in composer.json repositories
# in practice there are still many sporadic "Could not authenticate against github.com" errors
Expand All @@ -197,6 +197,8 @@ jobs:
# COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure PHP
env:
INSTALL_IN_MEMORY_CACHE_EXTS: ${{ matrix.install_inmemory_cache_exts }}
run: |
# Set memory limit and disable xdebug if not running phpcoverage
if [[ -z $(which php) ]]; then
Expand Down Expand Up @@ -234,6 +236,15 @@ jobs:
echo "Removed PHP extension $extension"
fi
echo "INSTALL_IN_MEMORY_CACHE_EXTS is $INSTALL_IN_MEMORY_CACHE_EXTS"
echo "matrix.install_inmemory_cache_exts is ${{ matrix.install_inmemory_cache_exts }}"
if [[ $INSTALL_IN_MEMORY_CACHE_EXTS == 'true' ]]; then
pecl install memcached
pecl install redis
sudo sh -c "echo 'apc.enable_cli=On' >> /etc/php/${{ matrix.php }}/cli/php.ini"
echo 'Installed in-memory cache extensions and set APCu to be enabled'
fi
echo "PHP has been configured"
- name: Install additional requirements
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,6 @@ The end-to-end suite as defined in `behat.yml`. Must be defined, specify 'root'

###### endtoend_config
The `behat.yml` config file to use if not using the root `behat.yml`. Only used if running behat tests in a different module

###### install_inmemory_cache_exts
Must be true or false. Determines whether to install in-memory cache extensions for framework unit tests.

0 comments on commit 6a8176b

Please sign in to comment.