Skip to content

Commit 81af595

Browse files
committed
Add CI workflow
1 parent 96ce050 commit 81af595

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php-version:
16+
- '8.4'
17+
- '8.5'
18+
19+
name: PHP ${{ matrix.php-version }}
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php-version }}
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate --strict
31+
32+
- name: Install Composer dependencies
33+
uses: "ramsey/composer-install@v3"
34+
35+
- name: Check composer.json normalization
36+
run: composer normalize --diff --dry-run
37+
38+
- name: Check README examples are in sync
39+
run: |
40+
vendor/bin/readme-examples-sync
41+
git diff --exit-code README.md || (echo "README.md is out of sync with example files. Run 'vendor/bin/readme-examples-sync' and commit the changes." && exit 1)
42+
43+
- name: Run PHP CS Fixer
44+
run: vendor/bin/php-cs-fixer check --diff

0 commit comments

Comments
 (0)