Skip to content

Commit 7b94c86

Browse files
authored
Merge pull request #2 from litebase/phpstan
Add PHPStan CI workflow and update config
2 parents 6fadbf2 + db891b1 commit 7b94c86

4 files changed

Lines changed: 53 additions & 25 deletions

File tree

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
name: Integration Tests
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
47

58
jobs:
6-
test:
7-
runs-on: ubuntu-latest
9+
test:
10+
runs-on: ubuntu-latest
811

9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v4
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1215

13-
- name: Set up PHP
14-
uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: "8.4"
16+
- name: Set up PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: "8.4"
1720

18-
- name: Install dependencies
19-
run: composer install
21+
- name: Install dependencies
22+
run: composer install
2023

21-
- name: Set up Docker Compose
22-
uses: docker/setup-compose-action@v1
24+
- name: Set up Docker Compose
25+
uses: docker/setup-compose-action@v1
2326

24-
- name: Prepare data directory with correct permissions
25-
run: |
26-
mkdir -p ./tests/.litebase
27-
chmod 777 ./tests/.litebase
27+
- name: Prepare data directory with correct permissions
28+
run: |
29+
mkdir -p ./tests/.litebase
30+
chmod 777 ./tests/.litebase
2831
29-
- name: Run integration tests
30-
run: vendor/bin/pest tests/Integration
32+
- name: Run integration tests
33+
run: vendor/bin/pest tests/Integration
3134

32-
- name: Report results
33-
if: always()
34-
run: echo "Integration tests completed."
35+
- name: Report results
36+
if: always()
37+
run: echo "Integration tests completed."

.github/workflows/phpstan.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: phpstan
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: "8.4"
20+
tools: composer:v2
21+
22+
- name: Install Dependencies
23+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
24+
25+
- name: Run PHPStan
26+
run: composer run phpstan

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
},
4949
"scripts": {
5050
"generate_open_api": "openapi-generator-cli generate -c openapi_config.yaml",
51+
"phpstan": "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M src tests",
5152
"pint": "vendor/bin/pint --no-interaction",
5253
"test": "vendor/bin/pest",
5354
"test-coverage": "vendor/bin/pest --coverage-html coverage"

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
parameters:
22
level: 9
3-
excludePaths:
4-
- src/Generated/*
53
paths:
64
- src
75
- tests

0 commit comments

Comments
 (0)