Skip to content

Merge pull request #1083 from yourpropertyexpert/docs/CCN2 #14

Merge pull request #1083 from yourpropertyexpert/docs/CCN2

Merge pull request #1083 from yourpropertyexpert/docs/CCN2 #14

Workflow file for this run

name: Tests
# Ensure tests pass whatever is the minor PHP version currently supported (see strategy.matrix.php)
# crossed with "lowest" setup (install the lowest possible dependency versions allowed by the range)
# and with "stable" setup (install the highest possible dependency stable versions allowed by the range)
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
php-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
matrix:
php: [ 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ]
setup: [ lowest, stable ]
exclude:
- setup: lowest
php: 7.2
- setup: lowest
php: 7.3
- setup: lowest
php: 7.4
name: PHP ${{ matrix.php }} - prefer-${{ matrix.setup }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: composer:v2
- name: Cache library packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.setup }}-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.setup }}-
- name: Cache test packages
id: composer-test-cache
uses: actions/cache@v3
with:
path: src/test/vendor
key: ${{ runner.os }}-php-test-${{ matrix.php }}-${{ matrix.setup }}-${{ hashFiles('src/test/composer.json') }}
restore-keys: ${{ runner.os }}-php-test-${{ matrix.php }}-${{ matrix.setup }}-
- name: Upgrade PHPUnit
if: matrix.php >= 7.2
run: cd src/test && composer require phpunit/phpunit:^5.7.27 --no-update --no-interaction --dev
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --no-progress --prefer-${{ matrix.setup }} --prefer-dist --no-progress --ignore-platform-req=php+
- name: Install test dependencies
if: steps.composer-test-cache.outputs.cache-hit != 'true'
run: cd src/test && composer update --no-progress --prefer-dist --prefer-stable --ignore-platform-req=php+
- name: Fix PHP compatibility
run: php src/test/php/fix-php-compatibility.php
- name: Execute Unit Tests
run: src/test/vendor/bin/phpunit -v