-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.57 KB
/
php-library-phpunit.yml
File metadata and controls
47 lines (45 loc) · 1.57 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
name: Run PHPUnit tests and Psalm
on:
workflow_call:
inputs:
php-version:
required: false
type: string
default: "8.5"
jobs:
phpunit:
name: "PHPUnit"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '${{ inputs.php-version }}'
deps:
- 'highest'
- 'lowest'
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"
- name: "Validate composer"
run: "composer validate"
- name: "Install dependencies with Composer"
uses: ramsey/composer-install@v2
with:
dependency-versions: "${{ matrix.deps }}"
- name: "Run PHPUnit"
run: "vendor/bin/phpunit --coverage-clover=coverage.clover.xml --log-junit log.junit.xml"
continue-on-error: "${{ matrix.deps == 'lowest' }}"
- name: "Upload coverage"
uses: actions/upload-artifact@v4
if: matrix.deps == 'highest'
with:
name: "coverage"
path: |
coverage.clover.xml
log.junit.xml