Skip to content

Commit d3f1006

Browse files
committed
Add GitHub Actions CI workflow for PHP checks
- Introduced `.github/workflows/php.yml` for continuous integration. - Configured tasks for code validation, style checks, static analysis, testing, and coverage reporting. - Ensured compatibility with PHP 8.2.16 and required extensions.
1 parent 93bc5b1 commit d3f1006

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/php.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: checks
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: '8.2.16'
24+
extensions: mbstring, intl
25+
26+
- name: Validate composer.json and composer.lock
27+
run: composer validate --strict
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-
37+
38+
- name: Install dependencies
39+
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
40+
41+
- name: Run style fixer
42+
run: composer run-script cs
43+
44+
- name: Run psalm
45+
run: composer run-script sca
46+
47+
- name: Run tests
48+
run: composer run-script test
49+
50+
- name: Run type coverage
51+
run: composer run-script type
52+
53+
- name: Run test coverage
54+
run: composer run-script coverage

0 commit comments

Comments
 (0)