From c29d32d9bf3c59585348f43bab53168e8c4d1eeb Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 12:57:51 -0600 Subject: [PATCH 01/13] Add PHP 8.2 to test matrix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 760da55..3af4357 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,7 +107,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - php-versions: ['7.3', '7.4', '8.0', '8.1'] + php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2'] steps: - name: Checkout uses: actions/checkout@v2 From 7cf219924366270a7b69b5d29a47bbb54a4c065c Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 12:58:55 -0600 Subject: [PATCH 02/13] Run jobs using PHP 8.2 --- .github/workflows/build.yml | 10 ++++++---- .github/workflows/coverage.yml | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3af4357..a80bec1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: none tools: composer:v2, cs2pr, phpcs env: @@ -38,13 +38,15 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: none tools: composer:v2, cs2pr, php-cs-fixer env: fail-fast: true - name: Code style (php-cs-fixer) run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr + env: + PHP_CS_FIXER_IGNORE_ENV: 1 phpstan: name: Code analysis (phpstan) @@ -55,7 +57,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: none tools: composer:v2, phpstan env: @@ -83,7 +85,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: none tools: composer:v2, psalm env: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f37faac..a6919dc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,7 +18,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: xdebug tools: composer:v2 env: @@ -52,7 +52,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: none tools: composer:v2,infection env: @@ -112,7 +112,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' coverage: none tools: composer:v2 - name: Get composer cache directory From fe4cc73f7e6bc416230d6ff1202ac5d33ee95f7f Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:00:49 -0600 Subject: [PATCH 03/13] Use GitHub actions version 3 --- .github/workflows/build.yml | 16 ++++++++-------- .github/workflows/coverage.yml | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a80bec1..fda7185 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -34,7 +34,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -53,7 +53,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -66,7 +66,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -81,7 +81,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -94,7 +94,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -112,7 +112,7 @@ jobs: php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2'] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -125,7 +125,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a6919dc..a0c9510 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,7 +14,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -27,7 +27,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -37,7 +37,7 @@ jobs: - name: Create code coverage run: vendor/bin/phpunit --testdox --verbose --coverage-xml=build/coverage --coverage-clover=build/coverage/clover.xml --log-junit=build/coverage/junit.xml - name: Store code coverage - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: code-coverage path: build/coverage @@ -48,7 +48,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -61,7 +61,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -69,7 +69,7 @@ jobs: - name: Install project dependencies run: composer upgrade --no-interaction --no-progress --prefer-dist - name: Obtain code coverage - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: code-coverage path: build/coverage @@ -106,7 +106,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Unshallow clone to provide blame information run: git fetch --unshallow - name: Setup PHP @@ -119,7 +119,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -127,7 +127,7 @@ jobs: - name: Install project dependencies run: composer upgrade --no-interaction --no-progress --prefer-dist - name: Obtain code coverage - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: code-coverage path: build/coverage From ae0507b99a4260505d6114ba0de5518629f6dfa9 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:01:10 -0600 Subject: [PATCH 04/13] Remove composer where is not required --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fda7185..28ca28f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: with: php-version: '8.2' coverage: none - tools: composer:v2, cs2pr, phpcs + tools: cs2pr, phpcs env: fail-fast: true - name: Code style (phpcs) @@ -40,7 +40,7 @@ jobs: with: php-version: '8.2' coverage: none - tools: composer:v2, cs2pr, php-cs-fixer + tools: cs2pr, php-cs-fixer env: fail-fast: true - name: Code style (php-cs-fixer) From cb3ff4fc3d424300888c328d5617a41c7f5004ae Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:01:36 -0600 Subject: [PATCH 05/13] Use phpcs folders configuration --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28ca28f..3b6f8c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: env: fail-fast: true - name: Code style (phpcs) - run: phpcs -q --report=checkstyle src/ tests/ | cs2pr + run: phpcs -q --report=checkstyle | cs2pr php-cs-fixer: name: Code style (php-cs-fixer) From 785c5246d73ff657a4b400a4dc688bb6428132f0 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:02:33 -0600 Subject: [PATCH 06/13] Replace HitHub directive ::set-output with $GITHUB_OUTPUT --- .github/workflows/build.yml | 6 +++--- .github/workflows/coverage.yml | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b6f8c5..310af1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,7 +64,7 @@ jobs: fail-fast: true - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: @@ -92,7 +92,7 @@ jobs: fail-fast: true - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: @@ -123,7 +123,7 @@ jobs: fail-fast: true - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a0c9510..f596a12 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: fail-fast: true - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: @@ -59,7 +59,7 @@ jobs: fail-fast: true - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: @@ -87,15 +87,15 @@ jobs: id: check-secrets run: | if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then - echo "::set-output name=github::yes" + echo "github=yes" >> $GITHUB_OUTPUT else - echo "::set-output name=github::no" + echo "github=no" >> $GITHUB_OUTPUT echo "::warning ::GITHUB_TOKEN non set" fi if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then - echo "::set-output name=sonar::yes" + echo "sonar=yes" >> $GITHUB_OUTPUT else - echo "::set-output name=sonar::no" + echo "sonar=no" >> $GITHUB_OUTPUT echo "::warning ::SONAR_TOKEN non set" fi @@ -117,7 +117,7 @@ jobs: tools: composer:v2 - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v3 with: From 400d8fbed6be0fcac9f63cae9abe17e4c674028c Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:05:45 -0600 Subject: [PATCH 07/13] Add workflow_dispatch to GitHub workflows --- .github/workflows/build.yml | 1 + .github/workflows/coverage.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 310af1d..6b243ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ name: build on: + workflow_dispatch: pull_request: branches: [ "main" ] push: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f596a12..035e942 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,5 +1,6 @@ name: coverage on: + workflow_dispatch: push: branches: [ "main" ] From bc3403d2a3680b849fdbd3bf0409596b810930d5 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:05:54 -0600 Subject: [PATCH 08/13] Update development tools --- .phive/phars.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index 7aa1b73..dee1723 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,9 +1,9 @@ - - - - - - + + + + + + From eb4d755ae1608cc067d4fc76b3209e8dfde6a064 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:06:03 -0600 Subject: [PATCH 09/13] Update license year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 27397b2..97083c0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 - 2022 PhpCfdi https://www.phpcfdi.com/ +Copyright (c) 2019 - 2023 PhpCfdi https://www.phpcfdi.com/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 62f87c384e3d21d03ace6fab8efd903a912e23b5 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:06:15 -0600 Subject: [PATCH 10/13] Fix badge-build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b19d2b..ede7f31 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor [badge-php-version]: https://img.shields.io/packagist/php-v/phpcfdi/sat-estado-cfdi?logo=php [badge-release]: https://img.shields.io/github/release/phpcfdi/sat-estado-cfdi?logo=git [badge-license]: https://img.shields.io/github/license/phpcfdi/sat-estado-cfdi?logo=open-source-initiative -[badge-build]: https://img.shields.io/github/workflow/status/phpcfdi/sat-estado-cfdi/build/main?logo=github-actions +[badge-build]: https://img.shields.io/github/actions/workflow/status/phpcfdi/sat-estado-cfdi/build.yml?branch=main&logo=github-actions [badge-reliability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_sat-estado-cfdi&metric=reliability_rating [badge-maintainability]: https://sonarcloud.io/api/project_badges/measure?project=phpcfdi_sat-estado-cfdi&metric=sqale_rating [badge-coverage]: https://img.shields.io/sonar/coverage/phpcfdi_sat-estado-cfdi/main?logo=sonarcloud&server=https%3A%2F%2Fsonarcloud.io From 0ff859d08a23d4e62b33e13b7302a038530c10a9 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:06:41 -0600 Subject: [PATCH 11/13] Update code-style configuration --- .php-cs-fixer.dist.php | 9 ++++++--- phpcs.xml.dist | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index f6f1c38..bfdf895 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -11,7 +11,7 @@ return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) - ->setCacheFile(__DIR__ . '/build/php_cs.cache') + ->setCacheFile(__DIR__ . '/build/php-cs-fixer.cache') ->setRules([ '@PSR12' => true, '@PSR12:risky' => true, @@ -23,11 +23,12 @@ 'no_empty_statement' => true, 'no_extra_blank_lines' => true, 'function_typehint_space' => true, + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']], 'no_blank_lines_after_phpdoc' => true, 'object_operator_without_whitespace' => true, 'binary_operator_spaces' => true, 'phpdoc_scalar' => true, - 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_comma_in_singleline' => true, 'single_quote' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_unused_imports' => true, @@ -35,16 +36,18 @@ 'standardize_not_equals' => true, 'concat_space' => ['spacing' => 'one'], 'linebreak_after_opening_tag' => true, + 'fully_qualified_strict_types' => true, // symfony:risky 'no_alias_functions' => true, 'self_accessor' => true, // contrib 'not_operator_with_successor_space' => true, + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const']], // @PSR12 sort_algorithm: none ]) ->setFinder( PhpCsFixer\Finder::create() ->in(__DIR__) ->append([__FILE__]) - ->exclude(['vendor', 'build']) + ->exclude(['vendor', 'tools', 'build']), ) ; diff --git a/phpcs.xml.dist b/phpcs.xml.dist index e7c3269..e7a9c2a 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,4 +1,4 @@ - + The EngineWorks (PSR-2 based) coding standard. From d3918a4e2f207d96690b4f366a6bc5ca4d84a2d6 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:15:18 -0600 Subject: [PATCH 12/13] Fix homepage/project link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0115a5b..776ed9e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contribuciones -Las contribuciones son bienvenidas. Aceptamos *Pull Requests* en el [repositorio GitHub][homepage]. +Las contribuciones son bienvenidas. Aceptamos *Pull Requests* en el [repositorio GitHub][project]. Este proyecto se apega al siguiente [Código de Conducta][coc]. Al participar en este proyecto y en su comunidad, deberás seguir este código. From bb08ad6dd89036ec784f9e6ebcf7f8ef865bc219 Mon Sep 17 00:00:00 2001 From: Carlos C Soto Date: Mon, 27 Feb 2023 13:36:18 -0600 Subject: [PATCH 13/13] Maintenance 2023-02-27 --- docs/CHANGELOG.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9ed3acf..71f65ad 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -7,7 +7,24 @@ Usamos [Versionado Semántico 2.0.0](SEMVER.md) por lo que puedes usar esta libr ## Cambios no liberados en una versión Pueden aparecer cambios no liberados que se integran a la rama principal, pero no ameritan una nueva liberación de -versión aunque sí su incorporación en la rama principal de trabajo, generalmente se tratan de cambios en el desarrollo. +versión, aunque sí su incorporación en la rama principal de trabajo. Generalmente, se tratan de cambios en el desarrollo. + +### Mantenimiento 2023-02-27 + +Esta es una actualización de mantenimiento que no genera una nueva liberación de código. + +- Se actualiza el año en la licencia. ¡Feliz 2023! +- Se actualiza la configuración de estilo de código a la utilizada por otros proyectos de phpCfdi. +- Se corrige la insignia `badge-build`. +- Se corrige la liga al proyecto en la guía de contribución. +- En los flujos de trabajo de integración continua: + - Se agrega PHP 8.2 a la matriz de pruebas + - Los trabajos se ejecutan en PHP 8.2 + - Se actualizan las acciones de GitHub a la versión 3. + - Se sustituye la directiva `::set-output` por `$GITHUB_OUTPUT`. + - Se elimina la instalación de `composer` donde no es necesaria. + - Se agrega el evento `workflow_dispatch`. +- Se actualizan las herramientas de desarrollo. ## Listado de cambios