Skip to content

Commit

Permalink
ci: added automatic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luislard committed Dec 13, 2023
1 parent 8e8276b commit 1f18091
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/php-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: PHP Unit Tests

on:
push:
paths:
- '**workflows/php-unit-tests.yml'
- '**.php'
- '**phpunit.xml.dist'
- '**composer.json'
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-tests:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'skip unit') }}

env:
USE_COVERAGE: 'no'

strategy:
fail-fast: false
matrix:
php-versions: [ '8.0', '8.1', '8.2' ]

steps:
- name: Checkout
uses: actions/checkout@v

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: zend.assertions=1, error_reporting=E_ALL, display_errors=On
coverage: ${{ env.USE_COVERAGE == 'yes' && 'xdebug' || 'none' }}

- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Run unit tests
run: composer tests

0 comments on commit 1f18091

Please sign in to comment.