Repository navigation
53 lines (44 loc) · 1.67 KB
/
Copy pathphpunit.yml
File metadata and controls
53 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: PHPUnit
on:
push:
pull_request:
jobs:
test:
name: PHPUnit PHP ${{ matrix.php }}${{ matrix.deps == 'latest' && ' (latest dependencies)' || '' }}
runs-on: ubuntu-24.04
strategy:
# report every PHP version, not only the first failing one
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
deps: ['locked']
include:
# composer.lock is resolved for PHP 8.2; projects on a newer PHP get newer
# dependencies (e.g. symfony/html-sanitizer 8), so test them as well
- php: '8.5'
deps: 'latest'
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: gd, mbstring, mysqli, pdo_sqlite
coverage: xdebug
# must be in the system php.ini to reach PHPUnit's isolated child processes
ini-values: auto_prepend_file=${{ github.workspace }}/tests/uts/phpunit-prepend.php
- name: Validate composer.json
run: composer validate
- name: Install dependencies
if: matrix.deps == 'locked'
run: composer install --prefer-dist --no-progress
- name: Update to the latest dependencies
if: matrix.deps == 'latest'
# without the platform PHP 8.2 of composer.json, Composer resolves for the PHP of the job
run: |
composer config --unset platform.php
composer update --prefer-dist --no-progress
composer show symfony/html-sanitizer | grep -E '^versions'
- name: Run PHPUnit
run: vendor/bin/phpunit --configuration tests/uts/phpunit.xml --coverage-text