This repository was archived by the owner on May 30, 2025. It is now read-only.
Empty commit for CI #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run PHPUnit tests | ||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
description: 'Operating system to run tests on' | ||
required: false | ||
type: 'string' | ||
default: 'ubuntu-latest' | ||
php: | ||
description: 'The version of PHP to use, in the format of X.Y' | ||
required: true | ||
type: 'string' | ||
phpunit-config: | ||
description: 'The PHPUnit configuration file to use' | ||
required: false | ||
type: 'string' | ||
default: 'phpunit.xml.dist' | ||
env: | ||
LOCAL_PHP: ${{ inputs.php }}-fpm | ||
PHPUNIT_CONFIG: ${{ inputs.phpunit-config }} | ||
LC_ALL: en_US.UTF-8 | ||
LANG: en_US.UTF-8 | ||
jobs: | ||
phpunit-tests: | ||
name: ${{ inputs.os }} | ||
runs-on: ${{ inputs.os }} | ||
# These tests can really drag on Windows CI runner! | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '${{ inputs.php }}' | ||
tools: phpunit-polyfills | ||
extensions: zip, sqlite3, pdo, pdo_sqlite | ||
- name: Install Composer dependencies (using composer-ci-matrix-tests.json) | ||
run: | | ||
rm composer.lock | ||
cp composer-ci-matrix-tests.json composer.json | ||
composer install --no-interaction --no-progress --optimize-autoloader | ||
- name: Run PHPUnit tests | ||
# Explicitly use the composer-installed version of phpunit | ||
# because there have been conflicts with other versions during CI. | ||
run: vendor/bin/phpunit --testdox |