Skip to content

Update tests.yml

Update tests.yml #57

Workflow file for this run

name: Automated Tests
on:
push:
branches:
- master
- main
tags:
- 'v*'
pull_request:
jobs:
tests:
name: Unit Tests (PHP ${{ matrix.php }})
strategy:
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: vendor
key: vendor-${{ hashFiles('composer.json') }}
- uses: php-actions/composer@v6
- name: Set up PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
coverage: pcov
- name: Run test suite
run: vendor/bin/phpunit tests --coverage-text --coverage-filter src
static:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: vendor
key: vendor-${{ hashFiles('composer.json') }}
- uses: php-actions/composer@v6
- uses: php-actions/phpstan@v3
with:
path: src
level: 5
format:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: vendor
key: vendor-${{ hashFiles('composer.json') }}
- uses: php-actions/composer@v6
- run: ./vendor/bin/php-cs-fixer fix && git diff --exit-code