Skip to content

Commit 6c8e27c

Browse files
authored
Create php_ci.yml
1 parent 2ed318a commit 6c8e27c

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/php_ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: PHP CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
14+
unit_tests:
15+
name: Unit tests
16+
runs-on: 'ubuntu-latest'
17+
strategy:
18+
matrix:
19+
php-versions: ['8.1', '8.2']
20+
fail-fast: false
21+
22+
steps:
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-versions }}
27+
tools: composer:v2
28+
29+
- name: Check PHP Version
30+
run: php -v
31+
32+
- uses: actions/checkout@v3
33+
34+
- name: Validate composer.json and composer.lock
35+
run: composer validate --strict
36+
37+
- name: Run composer install
38+
run: composer install -n --prefer-dist
39+
40+
- name: Run PHPUnit
41+
run: XDEBUG_MODE=coverage composer test
42+
43+
code_style:
44+
name: Code style
45+
runs-on: 'ubuntu-latest'
46+
strategy:
47+
matrix:
48+
php-versions: ['8.1', '8.2']
49+
fail-fast: false
50+
51+
steps:
52+
- name: Setup PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php-versions }}
56+
tools: composer:v2
57+
58+
- name: Check PHP Version
59+
run: php -v
60+
61+
- uses: actions/checkout@v3
62+
63+
- name: Validate composer.json and composer.lock
64+
run: composer validate --strict
65+
66+
- name: Run composer install
67+
run: composer install -n --prefer-dist
68+
69+
- name: Run linter
70+
run: composer linter

0 commit comments

Comments
 (0)