-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.15 KB
/
php.yml
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: PHPUnit
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: pcov
ini-values: pcov.directory=src
- uses: actions/checkout@v2
- name: Sleep for 30 seconds
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: Validate composer.json
run: composer validate
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress
- name: Run test suite
run: vendor/bin/phpunit tests --coverage-clover=clover.xml --coverage-html=coverage
- name: phpunit-coverage-badge
uses: timkrase/[email protected]
with:
push_badge: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: Code coverage (HTML)
path: coverage
- uses: actions/upload-artifact@v3
with:
name: Code coverage (Clover xml)
path: clover.xml