Skip to content

Bump dependencies

Bump dependencies #21

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php: [ '8.2', '8.1', '8.0', '7.4' ]
dependency-stability: [ 'prefer-stable' ]
include:
- php: '8.2'
phpunit: '^10.0'
- php: '8.1'
phpunit: '^10.0'
- php: '8.0'
phpunit: '^9.0'
- php: '7.4'
phpunit: '^9.0'
name: P${{ matrix.php }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
steps:
- uses: actions/checkout@v3
- name: Install PHP versions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: "pcov"
- name: Get Composer Cache Directory 2
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: actions-cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache PHP dependencies
uses: actions/cache@v3
id: vendor-cache
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
if: steps.vendor-cache.outputs.cache-hit != 'true'
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Update Dependencies with latest stable
if: matrix.dependency-stability == 'prefer-stable'
run: composer update --prefer-stable
- name: Update Dependencies with lowest stable
if: matrix.dependency-stability == 'prefer-lowest'
run: composer update --prefer-stable --prefer-lowest
- name: Force PHPUnit version
run: composer require --dev phpunit/phpunit:${{ matrix.phpunit }} --update-with-dependencies -n --ansi
- name: Execute tests (Unit and Feature tests) via PHPUnit 9
if: matrix.phpunit == '^9.0'
run: vendor/bin/phpunit --coverage-clover=coverage.xml -c phpunit9.xml
- name: Execute tests (Unit and Feature tests) via PHPUnit 10
if: matrix.phpunit == '^10.0'
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: true