Repository navigation
52 lines (43 loc) · 1.59 KB
/
Copy pathunit-testing.yml
File metadata and controls
52 lines (43 loc) · 1.59 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
name: Unit Testing
on: [ pull_request ]
jobs:
phpunit:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
matrix:
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
include:
# libxml2 2.14+ (ubuntu-26.04 onwards) parses HTML as HTML5, which skips the tests for
# libxml's older HTML parser, so the coverage job stays on a runner that still has it.
- php-versions: '8.3'
os: ubuntu-24.04
report: true
name: PHP ${{ matrix.php-versions }} PHPUnit Test
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: error_reporting=E_ALL
# zip is needed by the .docx and .odt examples, which ExamplesTest runs.
extensions: dom, simplexml, zip
- name: Install Composer Dependencies
uses: ramsey/composer-install@v4
- name: Log debug information
run: |
php --version
composer --version
- name: Run PHPUnit Tests without coverage
if: ${{ ! matrix.report }}
run: ./vendor/bin/phpunit
- name: Run PHPUnit Tests with coverage
if: ${{ matrix.report }}
run: ./vendor/bin/phpunit --coverage-clover=./coverage/coverage1.xml
- name: Check Code Coverage
if: ${{ matrix.report }}
uses: codecov/codecov-action@v7
with:
directory: ./coverage/
token: ${{ secrets.CODECOV_TOKEN }}