Skip to content

Tests

Tests #447

Workflow file for this run

name: Tests
on:
push:
branches:
# Push events on main branch
- main
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php-versions }}'
tools: composer:v2
- name: Validate composer.json
run: composer validate
- name: Get composer cache directory
id: composercache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
#key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --no-interaction
- name: Run PHPUnit tests.
run: composer test