Skip to content

Commit 73eb7e9

Browse files
authored
Create php.yml
1 parent 3dc1b79 commit 73eb7e9

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/php.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php-versions: ['7,4', '8.0', '8.1', '8.2', '8.3']
16+
name: PHP ${{ matrix.php-versions }} Test
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-versions }}
24+
25+
- name: Validate composer.json and composer.lock
26+
run: composer validate --strict
27+
28+
- name: Cache Composer packages
29+
id: composer-cache
30+
uses: actions/cache@v3
31+
with:
32+
path: vendor
33+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-php-
36+
37+
- name: Install dependencies
38+
run: composer install --prefer-dist --no-progress
39+
40+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
41+
# Docs: https://getcomposer.org/doc/articles/scripts.md
42+
43+
- name: Run test suite
44+
run: composer test
45+
46+
- name: Run PHPStan
47+
run: composer phpstan

0 commit comments

Comments
 (0)