Skip to content

Commit 3987a40

Browse files
committed
feat: github actions
1 parent dd71a0a commit 3987a40

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: check style
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: PHP-CS-Fixer
14+
uses: docker://oskarstark/php-cs-fixer-ga
15+
with:
16+
args: --config=.php-cs-fixer.dist.php --diff --dry-run

.github/workflows/phpstan.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: static analysis
2+
3+
on: [push]
4+
5+
jobs:
6+
phpstan:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: PHPStan
14+
uses: docker://oskarstark/phpstan-ga
15+
with:
16+
args: analyse

.github/workflows/phpunit.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PHPUnit
2+
3+
on: [push]
4+
5+
jobs:
6+
phpunit:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
php_version: [8.1, 8.2, 8.3]
12+
prefer:
13+
- stable
14+
- lowest
15+
16+
name: PHP-${{ matrix.php_version }}-${{ matrix.prefer }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-interaction --no-progress
29+
30+
- name: Run PHPUnit
31+
run: vendor/bin/phpunit

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"scripts": {
3030
"test": "./vendor/bin/phpunit",
31-
"lint": "./vendor/bin/php-cs-fixer fix"
31+
"lint": "./vendor/bin/php-cs-fixer fix",
32+
"analyse": "./vendor/bin/phpstan analyse"
3233
}
3334
}

0 commit comments

Comments
 (0)