Skip to content

Commit 7a7c455

Browse files
committed
ci: php.yml
1 parent d996800 commit 7a7c455

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/php.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
unit:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
php_version: ['8.0', '8.1']
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Setup PHP with PECL extension
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php_version }}
28+
29+
- name: Cache Composer packages
30+
id: composer-cache
31+
uses: actions/cache@v3
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-php-${{ matrix.php_version }}
37+
38+
- name: Install dependencies
39+
run: composer install --prefer-dist --no-progress
40+
41+
- name: PHPStan
42+
run: vendor/bin/phpstan analyze
43+
44+
- name: PHPUnit
45+
run: vendor/bin/phpunit --coverage-clover coverage.xml
46+
47+
- name: Coverage
48+
run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)