Skip to content

Automatic PHP Unit Test #12

Automatic PHP Unit Test

Automatic PHP Unit Test #12

Workflow file for this run

name: PHPUnit CI
on:
push:
pull_request:
jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Use version-specific composer.lock
run: |
PHP_VERSION=${{ matrix.php }}
if [[ "$PHP_VERSION" == 7.4* ]]; then
cp composer.lock-74 composer.lock
elif [[ "$PHP_VERSION" == 8.0* ]]; then
cp composer.lock-80 composer.lock
elif [[ "$PHP_VERSION" == 8.1* ]]; then
cp composer.lock-81 composer.lock
elif [[ "$PHP_VERSION" == 8.2* ]]; then
cp composer.lock-82 composer.lock
elif [[ "$PHP_VERSION" == 8.3* ]]; then
cp composer.lock-83 composer.lock
elif [[ "$PHP_VERSION" == 8.4* ]]; then
cp composer.lock-84 composer.lock
fi
- name: Install dependencies
run: composer install
- name: Run tests
run: vendor/bin/phpunit