Skip to content

Commit db793d5

Browse files
committed
chore: add Larastan for static analysis and CI workflow
Add Larastan as a development dependency to enable static code analysis for the Laravel project. This helps in identifying potential bugs and improving code quality without running the application. Additionally, a GitHub Actions CI workflow is introduced to automate testing, static analysis, and code style checks on every push or pull request. The workflow includes steps for PHP setup, dependency installation, PHPUnit tests, PHPStan analysis, and Pint code style verification. A `phpstan.neon` configuration file is also added to customize the static analysis process, including paths to analyze and the desired level of strictness.
1 parent 876cff8 commit db793d5

File tree

4 files changed

+1514
-911
lines changed

4 files changed

+1514
-911
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up PHP
11+
uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: '8.0'
14+
- name: Install dependencies
15+
run: composer install --prefer-dist --no-progress
16+
- name: Run PHPUnit tests
17+
run: vendor/bin/phpunit
18+
- name: Run PHPStan analysis
19+
run: vendor/bin/phpstan analyse
20+
- name: Check code style
21+
run: vendor/bin/pint --test

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"require-dev": {
1515
"fakerphp/faker": "^1.9.1",
16+
"larastan/larastan": "^2.3",
1617
"laravel/pint": "^1.0",
1718
"laravel/sail": "^1.0.1",
1819
"mockery/mockery": "^1.4.4",

0 commit comments

Comments
 (0)