Repository navigation
80 lines (67 loc) · 2.06 KB
/
Copy pathTest.yml
File metadata and controls
80 lines (67 loc) · 2.06 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Test
on:
push:
paths:
- '**.php'
- 'composer.json'
- 'tests/Fixtures/compliance/**'
- 'phpunit.xml.dist'
- '.github/workflows/Test.yml'
branches:
- 'main'
pull_request:
paths:
- '**.php'
- 'composer.json'
- 'tests/Fixtures/compliance/**'
- 'phpunit.xml.dist'
- '.github/workflows/Test.yml'
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.3'
coverage: pcov
- php: '8.4'
coverage: pcov
- php: '8.5'
coverage: xdebug
- php: '8.6'
coverage: xdebug
name: PHP ${{ matrix.php }} Test
steps:
- name: Git checkout
uses: actions/checkout@v7.0.1
- name: Setup PHP
uses: shivammathur/setup-php@2.37.2
with:
php-version: ${{ matrix.php }}
extensions: dom, json, mbstring, simplexml, xml, xmlwriter
coverage: ${{ matrix.coverage }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup problem matchers for PHP syntax check
run: echo "::add-matcher::.github/php-syntax.json"
- run: |
! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Run PHP CS Fixer
if: matrix.php == '8.3'
run: composer cs
- name: Run PHPStan
run: composer phpstan
- name: Execute tests
run: composer test -- --log-junit=junit.xml --coverage-clover=coverage.xml --display-warnings
- name: Require complete coverage
run: php tools/assert-coverage.php coverage.xml
- name: Run codecov
uses: codecov/codecov-action@v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}