Skip to content

Commit 5696c54

Browse files
CAFernandesclaude
andcommitted
fix: Atualiza GitHub Actions e configuração do PHPStan
- Atualiza workflow CI para usar comandos composer corretos - Adiciona PHP 8.4 na matriz de testes - Corrige comandos para usar composer test, phpstan e cs:check - Remove php-cs-fixer (projeto usa phpcs) - Adiciona extensão pdo_mysql necessária - Configura PHPStan para excluir testes e usar stub files - Adiciona .env.example para documentar configuração - Adiciona branch v1.0.2 no trigger do CI Isso garante que o ambiente do GitHub Actions seja consistente com o ambiente local. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7e072d4 commit 5696c54

File tree

3 files changed

+40
-32
lines changed

3 files changed

+40
-32
lines changed

.env.example

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
# Exemplo de configuração .env para express-php/cycle-orm-extension
1+
# Database Configuration
2+
DB_CONNECTION=sqlite
3+
DB_DATABASE=database/database.sqlite
24

3-
# Banco de Dados
4-
DB_CONNECTION=mysql
5-
DB_HOST=localhost
6-
DB_PORT=3306
7-
DB_DATABASE=express_api
8-
DB_USERNAME=root
9-
DB_PASSWORD=
5+
# MySQL Configuration (if DB_CONNECTION=mysql)
6+
# DB_HOST=127.0.0.1
7+
# DB_PORT=3306
8+
# DB_USERNAME=root
9+
# DB_PASSWORD=
1010

11-
# Configurações do Cycle ORM
12-
CYCLE_SCHEMA_CACHE=true
13-
CYCLE_AUTO_SYNC=false
14-
CYCLE_SCHEMA_STRICT=false
15-
16-
# Outras opções
17-
APP_ENV=local
11+
# Application Environment
12+
APP_ENV=development
1813
APP_DEBUG=true
19-
APP_URL=http://localhost
14+
15+
# Cycle ORM Debug Options
16+
CYCLE_LOG_QUERIES=false
17+
CYCLE_PROFILE_QUERIES=false

.github/workflows/ci.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [ main, develop, v1.0.2 ]
66
pull_request:
77
branches: [ main ]
88

@@ -12,39 +12,45 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
php-version: [8.1, 8.2, 8.3]
15+
php-version: [8.1, 8.2, 8.3, 8.4]
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919

2020
- name: Setup PHP
2121
uses: shivammathur/setup-php@v2
2222
with:
2323
php-version: ${{ matrix.php-version }}
24-
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
24+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pdo_mysql
25+
coverage: xdebug
2526

2627
- name: Cache Composer packages
2728
id: composer-cache
2829
uses: actions/cache@v3
2930
with:
3031
path: vendor
31-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
32+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
3233
restore-keys: |
33-
${{ runner.os }}-php-
34+
${{ runner.os }}-php-${{ matrix.php-version }}-
3435
3536
- name: Install dependencies
36-
run: composer install --prefer-dist --no-progress
37+
run: composer install --prefer-dist --no-progress --no-interaction
3738

38-
- name: Run PHPStan
39-
run: vendor/bin/phpstan analyse --no-progress
39+
- name: Run PHPUnit Tests
40+
run: composer test
4041

41-
- name: Run PHP CS Fixer
42-
run: vendor/bin/php-cs-fixer fix --dry-run --diff
42+
- name: Run PHPStan Analysis
43+
run: composer phpstan
4344

44-
- name: Run PHPUnit
45-
run: vendor/bin/phpunit --coverage-clover=coverage.xml
45+
- name: Check PSR-12 Compliance
46+
run: composer cs:check
47+
48+
- name: Generate Coverage Report
49+
if: matrix.php-version == '8.4'
50+
run: composer test-coverage
4651

4752
- name: Upload coverage to Codecov
53+
if: matrix.php-version == '8.4'
4854
uses: codecov/codecov-action@v3
4955
with:
5056
file: ./coverage.xml

phpstan.neon

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ parameters:
33
treatPhpDocTypesAsCertain: false
44
paths:
55
- src
6-
- tests
76
excludePaths:
8-
- tests/HealthCheckTest.php
9-
- tests/Integration/FullIntegrationTest.php
7+
- tests
8+
bootstrapFiles:
9+
- vendor/autoload.php
1010
ignoreErrors:
1111
- '#Parameter \#1 of callable .* expects Express\\Http\\Request, .* given#'
1212

@@ -15,3 +15,7 @@ parameters:
1515
- Express\Http\Request
1616
- Express\Http\Response
1717
- Express\Core\Application
18+
19+
# Stub files for better type inference
20+
stubFiles:
21+
- vendor/cafernandes/express-php/src/Http/Request.php

0 commit comments

Comments
 (0)