Skip to content

Don't export php-cs-fixer settings #9

Don't export php-cs-fixer settings

Don't export php-cs-fixer settings #9

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
test-format:
name: 'Code format check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: 3-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer format
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- run: git status
- run: git diff-files --quiet --exit-code
test-static:
name: 'Static analysis check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: 3-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer analyze
test-basic:
name: 'Basic test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.4
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: 3-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit tests
env:
MYSQLI_HOST: localhost:${{ job.services.mysql.ports['3306'] }}
tests:
name: 'PHP ${{ matrix.php-versions }} Twig ${{ matrix.twig }} tests'
needs:
- test-format
- test-static
- test-basic
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- 8.4
twig:
- 2
- 3
exclude:
# Twig 2 is EOL and breaks in 8.4
- php-versions: 8.4
twig: 2
# Twig 3 doesn't support < 8.1
- php-versions: 7.4
twig: 3
- php-versions: 8.0
twig: 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
key: ${{ matrix.twig }}-${{ hashFiles('./composer.lock') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer require twig/twig ^${{ matrix.twig }}
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit --no-coverage tests