Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tests

on:
pull_request:
workflow_dispatch:

jobs:
phpunit:
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]

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

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

# phpbench (benchmarks only) does not support the oldest PHP versions
- name: Remove benchmark dependency
run: composer remove --dev phpbench/phpbench --no-update --no-interaction

- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-interaction

- name: Lint
run: find src tests/unit -name '*.php' -print0 | xargs -0 -n1 php -l

- name: Run tests
run: composer test

traits:
name: Generated traits are up to date
runs-on: ubuntu-latest

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

- name: Check traits
run: python3 tools/generate-traits.py --check
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"phpbench/phpbench": "^1.0",
"ext-libxml": "*",
"ext-simplexml": "*",
"phpunit/phpunit": "^7.5 || ^9.5"
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
},
"license": "MIT",
"version": "4.2.0",
Expand Down
Loading