Skip to content

Merge pull request #15 from visto9259/master #18

Merge pull request #15 from visto9259/master

Merge pull request #15 from visto9259/master #18

Workflow file for this run

name: Build
on:
push:
pull_request:
jobs:
build:
strategy:
matrix:
php_version: ['8.1', '8.2']
deps: ['lowest', 'latest']
include:
- code-coverage: 'yes'
php_version: '8.2'
deps: 'latest'
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php_version}}
- name: Check PHP version
run: php -v
- name: test deps
run: echo ${{ matrix.deps }}
- uses: actions/checkout@v4
name: Checkout branch
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{matrix.php_version}}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php--${{matrix.php_version}}
- name: Install/update dependencies lowest
if: ${{ matrix.deps == 'lowest' }}
run: composer update --prefer-lowest --prefer-stable --no-progress
- name: Install/update dependencies latest
if: ${{ matrix.deps == 'latest' }}
run: composer update --no-progress
- name: Run PHPUnit test suite with coverage
if: ${{ matrix.code-coverage == 'yes' }}
run: composer test-coverage
- name: Run PHPUnit test suite no coverage
if: ${{ matrix.code-coverage != 'yes' }}
run: composer test