Skip to content

Commit c84c30e

Browse files
committed
Se ha modificado el workflow ci.yml. Se cambió el código a psr-12. Se hizo una pequeña corrección en HttpCurlClient para que el programa no se caiga. Se hicieron correcciones en los tests. Se añadió .scrutinizer y phpstan. Se actualizó y corrigió composer.json. Se corrigió phpunit.xml. Se efectuaron las pruebas necesarias.
1 parent ebd35ab commit c84c30e

18 files changed

Lines changed: 2523 additions & 3111 deletions

.github/workflows/ci.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,12 @@ env:
88
env_var: ${{ vars.ENV_CONTEXT_VAR }}
99

1010
jobs:
11-
display-variables:
12-
name: ${{ vars.JOB_NAME }}
13-
# You can use configuration variables with the `vars` context for dynamic jobs
14-
if: ${{ vars.USE_VARIABLES == 'true' }}
15-
runs-on: ${{ vars.RUNNER }}
16-
environment: ${{ vars.ENVIRONMENT_STAGE }}
17-
steps:
18-
- name: Use variables
19-
run: |
20-
echo "LIBREDTE_HASH : $LIBREDTE_HASH"
21-
echo "LIBREDTE_RUT : $LIBREDTE_RUT"
22-
env:
23-
LIBREDTE_HASH: ${{ secrets.LIBREDTE_HASH }}
24-
LIBREDTE_RUT: ${{ vars.LIBREDTE_RUT }}
25-
2611
test:
2712
runs-on: ubuntu-latest
2813

2914
strategy:
3015
matrix:
31-
php-version: ['7.3', '8.0'] # Puedes cambiar las versiones según necesites
16+
php-version: ['8.3'] # Puedes cambiar las versiones según necesites
3217

3318
steps:
3419
- name: Check out repository code
@@ -58,5 +43,19 @@ jobs:
5843
name: tests-testdox-php_${{ matrix.php-version }}.txt
5944
path: var/tests-testdox.txt
6045

46+
- name: Upload Coverage Report
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: tests-coverage-php_${{ matrix.php-version }}.txt
50+
path: var/tests-coverage.txt
51+
52+
- name: Upload to Codecov
53+
uses: codecov/codecov-action@v4
54+
with:
55+
token: ${{ secrets.CODECOV_TOKEN }}
56+
files: var/tests-coverage.xml
57+
fail_ci_if_error: true
58+
verbose: true
59+
6160
- name: Display PHP version
6261
run: php -v

.scrutinizer.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
checks:
2+
php: true
3+
4+
build:
5+
nodes:
6+
analysis:
7+
tests:
8+
override:
9+
- php-scrutinizer-run
10+
- command: composer tests_dte_temp
11+
coverage:
12+
file: var/tests-coverage.xml
13+
format: clover
14+
environment:
15+
php:
16+
version: 8.2.1
17+
pecl_extensions:
18+
- xdebug
19+
dependencies:
20+
before:
21+
- composer install --no-progress --prefer-dist
22+
23+
tools:
24+
php_code_sniffer:
25+
enabled: true
26+
config:
27+
standard: PSR12
28+
29+
filter:
30+
paths:
31+
- src/*
32+
excluded_paths:
33+
- resources/*
34+
- tests/*
35+
- tools/*
36+
- var/*
37+
- vendor/*

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@
1717
},
1818
"config": {
1919
"platform": {
20-
"php": "7.3"
20+
"php": "8.2"
2121
}
2222
},
2323
"require": {
24-
"php": "^7.3 || ^8.0",
24+
"php": "^8.2 || ^8.3",
2525
"ext-curl": "*"
2626
},
2727
"require-dev": {
28-
"phpdocumentor/phpdocumentor": "^2.9",
29-
"phpunit/phpunit": "^9.2",
28+
"friendsofphp/php-cs-fixer": "^3.63",
29+
"phpstan/phpstan": "^1.12",
30+
"phpunit/phpunit": "^11.3",
3031
"vlucas/phpdotenv": "^5.6"
3132
},
3233
"autoload": {
@@ -39,6 +40,10 @@
3940
"tests_contab": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite contab",
4041
"tests_pagos": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite pagos",
4142
"tests_readonly": "vendor/bin/phpunit --testsuite readonly --filter 'test_dte_buscar_documento_emitido|test_dte_estado|test_dte_consultar|test_dte_ted|test_pagos_buscar_cobro|test_pagos_info_cobro'",
42-
"tests_dte_temp": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite dte_temp"
43+
"tests_dte_temp": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml --testsuite dte_temp",
44+
"phpcs-fix": "php-cs-fixer fix -v --config=php-cs-fixer.php .",
45+
"phpcs-fix-dry-run": "php-cs-fixer fix -v --dry-run --diff --config=php-cs-fixer.php .",
46+
"phpstan": "phpstan analyse --configuration=phpstan.neon --memory-limit=1G",
47+
"phpstan-export": "phpstan analyse --configuration=phpstan.neon --level 9 --generate-baseline"
4348
}
4449
}

0 commit comments

Comments
 (0)