Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from eclipxe13/development
Browse files Browse the repository at this point in the history
Review 2021-09-03
  • Loading branch information
eclipxe13 authored Sep 4, 2021
2 parents 8a700c3 + c27f5d1 commit 089eae0
Show file tree
Hide file tree
Showing 28 changed files with 383 additions and 118 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# see https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
/.github/* @phpcfdi/core-mantainers
112 changes: 112 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: build
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
schedule:
- cron: '0 16 * * 0' # sunday 16:00

jobs:

ci: # this job runs all the development tools and upload code coverage to scrutinizer

name: PHP 8.0 (full)
runs-on: "ubuntu-latest"

steps:

- name: Checkout
uses: actions/checkout@v2

# see https://github.com/marketplace/actions/setup-php-action
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: dom
coverage: xdebug
tools: composer:v2, phpcs, php-cs-fixer, phpstan, psalm, infection, cs2pr
env:
fail-fast: true

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist

- name: Code style (phpcs)
run: phpcs -q --report=checkstyle | cs2pr

- name: Code style (php-cs-fixer)
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

- name: Tests (phpunit with code coverage)
run: vendor/bin/phpunit --testdox --verbose --coverage-clover=build/coverage-clover.xml --coverage-xml=build/coverage --log-junit=build/coverage/junit.xml

- name: Code analysis (phpstan)
run: phpstan analyse --no-progress --verbose

- name: Code analysis (psalm)
run: psalm --no-progress --output-format=github

- name: Mutation testing analysis
run: infection --skip-initial-tests --coverage=build/coverage --no-progress --no-interaction --logger-github

# see https://github.com/marketplace/actions/action-scrutinizer
- name: Upload code coverage to scrutinizer
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage-clover.xml"
continue-on-error: true

build: # this job runs tests on all php supported versions

name: PHP ${{ matrix.php-versions }} (tests)
runs-on: "ubuntu-latest"

strategy:
matrix:
php-versions: ['7.3', '7.4']

steps:

- name: Checkout
uses: actions/checkout@v2

# see https://github.com/marketplace/actions/setup-php-action
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: dom
coverage: none
tools: composer:v2, cs2pr
env:
fail-fast: true

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install project dependencies
run: composer upgrade --no-interaction --no-progress --prefer-dist

- name: Tests
run: vendor/bin/phpunit --testdox --verbose
9 changes: 9 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="php-cs-fixer" version="^3.1.0" installed="3.1.0" location="./tools/php-cs-fixer" copy="false"/>
<phar name="phpcs" version="^3.6.0" installed="3.6.0" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.6.0" installed="3.6.0" location="./tools/phpcbf" copy="false"/>
<phar name="phpstan" version="^0.12.98" installed="0.12.98" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="^4.9.3" installed="4.9.3" location="./tools/psalm" copy="false"/>
<phar name="infection" version="^0.23.0" installed="0.23.0" location="./tools/infection" copy="false"/>
</phive>
37 changes: 19 additions & 18 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
<?php

/**
* @noinspection PhpUndefinedClassInspection
* @noinspection PhpUndefinedNamespaceInspection
* @see https://cs.symfony.com/doc/ruleSets/
* @see https://cs.symfony.com/doc/rules/
*/

declare(strict_types=1);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/build/php_cs.cache')
->setRules([
'@PSR2' => true,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'@PHP71Migration' => true,
'@PSR12' => true,
'@PSR12:risky' => true,
'@PHP71Migration:risky' => true,
// '@PHP73Migration' => true,
'@PHP73Migration' => true,
// PSR12 (remove when php-cs-fixer reaches ^3.1.1)
'class_definition' => ['space_before_parenthesis' => true],
// symfony
'class_attributes_separation' => true,
'whitespace_after_comma_in_array' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'function_typehint_space' => true,
'no_alias_functions' => true,
'trailing_comma_in_multiline_array' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => true,
'phpdoc_scalar' => true,
'self_accessor' => true,
'no_trailing_comma_in_singleline_array' => true,
'single_quote' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'yoda_style' => ['equal' => true, 'identical' => true, 'less_and_greater' => null],
'standardize_not_equals' => true,
// contrib
'concat_space' => ['spacing' => 'one'],
'not_operator_with_successor_space' => true,
'single_blank_line_before_namespace' => true,
'linebreak_after_opening_tag' => true,
'blank_line_after_opening_tag' => true,
'ordered_imports' => true,
'array_syntax' => ['syntax' => 'short'],
// symfony:risky
'no_alias_functions' => true,
'self_accessor' => true,
// contrib
'not_operator_with_successor_space' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->append([__FILE__])
->exclude(['vendor', 'build'])
)
;
18 changes: 7 additions & 11 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
filter:
excluded_paths:
- 'tests/'
dependency_paths:
- 'tools/'
- 'vendor/'

build:
dependencies:
override:
- composer self-update --2 --stable --no-interaction --no-progress
- composer remove squizlabs/php_codesniffer friendsofphp/php-cs-fixer phpstan/phpstan --dev --no-interaction --no-progress --no-update
- composer update --no-interaction --no-progress
- composer update --no-interaction --prefer-dist
nodes:
analysis:
project_setup:
override: true
analysis: # see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/
project_setup: {override: true}
tests:
override:
- php-scrutinizer-run --enable-security-analysis
- phpcs-run --standard=phpcs.xml.dist src/ tests/
- command: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
coverage:
file: coverage.clover
format: clover
tools:
external_code_coverage: true
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Código de Conducta convenido para Contribuyentes
# Código de Conducta Convenido para Contribuyentes

## Nuestro compromiso

Expand Down Expand Up @@ -37,7 +36,7 @@ Este código de conducta aplica tanto a espacios del proyecto como a espacios p

## Aplicación

Instancias de comportamiento abusivo, acosador o inaceptable de otro modo podrán ser reportadas a los administradores de la comunidad responsables del cumplimiento a través de [[email protected]](). Todas las quejas serán evaluadas e investigadas de una manera puntual y justa.
Instancias de comportamiento abusivo, acosador o inaceptable de otro modo podrán ser reportadas a los administradores de la comunidad responsables del cumplimiento a través de [[email protected]](mailto:[email protected]). Todas las quejas serán evaluadas e investigadas de una manera puntual y justa.

Todos los administradores de la comunidad están obligados a respetar la privacidad y la seguridad de quienes reporten incidentes.

Expand Down
15 changes: 13 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Considera las siguientes directrices:
```shell
# Actualiza tus dependencias
composer update
phive update

# Verificación de estilo de código
composer dev:check-style
Expand All @@ -74,12 +75,22 @@ composer dev:fix-style
# Ejecución de pruebas
composer dev:test

# Ejecución todo en uno, corregir estilo, verificar estilo y correr pruebas
# Ejecución todo en uno: corregir estilo, verificar estilo y correr pruebas
composer dev:build
```

## Ejecutar GitHub Actions localmente

Puedes usar [`act`](https://github.com/nektos/act) para ejecutar GitHub Actions localmente, tal como se
muestra en [`actions/setup-php-action`](https://github.com/marketplace/actions/setup-php-action#local-testing-setup)
puedes ejecutar el siguiente comando:

```shell
act -P ubuntu-latest=shivammathur/node:latest
```

[phpCfdi]: https://github.com/phpcfdi/
[project]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr
[contributors]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/graphs/contributors
[coc]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/master/CODE_OF_CONDUCT.md
[coc]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/main/CODE_OF_CONDUCT.md
[issues]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/issues
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

> Consulta el estado de un CFDI en el webservice del SAT usando HTTP (PSR-17 y PSR-18)
:us: The documentation of this project is in spanish as this is the natural language for intented audience.
:us: The documentation of this project is in spanish as this is the natural language for intended audience.

:mexico: La documentación del proyecto está en español porque ese es el lenguaje principal de los usuarios.

Expand Down Expand Up @@ -88,7 +88,7 @@ Puedes ver los siguientes recursos para integrar `phpcfdi/sat-estado-cfdi-http-p
- [Integración genérica](docs/integracion-generica.md)
Implementación de los PSR-17 y PSR-18 que decidas, ejemplo usando Sunrise.

## Compatilibilidad
## Compatibilidad

Esta librería se mantendrá compatible con al menos la versión con
[soporte activo de PHP](https://www.php.net/supported-versions.php) más reciente.
Expand All @@ -106,22 +106,22 @@ y recuerda revisar el archivo de tareas pendientes [TODO][] y el archivo [CHANGE
The `phpcfdi/sat-estado-cfdi-http-psr` library is copyright © [PhpCfdi](https://www.phpcfdi.com/)
and licensed for use under the MIT License (MIT). Please see [LICENSE][] for more information.

[contributing]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/master/CONTRIBUTING.md
[changelog]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/master/docs/CHANGELOG.md
[todo]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/master/docs/TODO.md
[contributing]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/main/CONTRIBUTING.md
[changelog]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/main/docs/CHANGELOG.md
[todo]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/main/docs/TODO.md

[source]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr
[release]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/releases
[license]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/master/LICENSE
[build]: https://travis-ci.com/phpcfdi/sat-estado-cfdi-http-psr?branch=master
[license]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/blob/main/LICENSE
[build]: https://github.com/phpcfdi/sat-estado-cfdi-http-psr/actions/workflows/build.yml?query=branch:main
[quality]: https://scrutinizer-ci.com/g/phpcfdi/sat-estado-cfdi-http-psr/
[coverage]: https://scrutinizer-ci.com/g/phpcfdi/sat-estado-cfdi-http-psr/code-structure/master/code-coverage
[coverage]: https://scrutinizer-ci.com/g/phpcfdi/sat-estado-cfdi-http-psr/code-structure/main/code-coverage
[downloads]: https://packagist.org/packages/phpcfdi/sat-estado-cfdi-http-psr

[badge-source]: https://img.shields.io/badge/source-phpcfdi/sat--estado--cfdi--http--psr-blue?style=flat-square
[badge-release]: https://img.shields.io/github/release/phpcfdi/sat-estado-cfdi-http-psr?style=flat-square
[badge-license]: https://img.shields.io/github/license/phpcfdi/sat-estado-cfdi-http-psr?style=flat-square
[badge-build]: https://img.shields.io/travis/com/phpcfdi/sat-estado-cfdi-http-psr/master?style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/phpcfdi/sat-estado-cfdi-http-psr/master?style=flat-square
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/phpcfdi/sat-estado-cfdi-http-psr/master?style=flat-square
[badge-build]: https://img.shields.io/github/workflow/status/phpcfdi/sat-estado-cfdi-http-psr/build/main?style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/phpcfdi/sat-estado-cfdi-http-psr/main?style=flat-square
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/phpcfdi/sat-estado-cfdi-http-psr/main?style=flat-square
[badge-downloads]: https://img.shields.io/packagist/dt/phpcfdi/sat-estado-cfdi-http-psr?style=flat-square
Loading

0 comments on commit 089eae0

Please sign in to comment.