diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2f629c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +--- +name: Code style and static analysis + +on: + pull_request: + push: + branches: [master] + +permissions: + contents: read + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + + container: + image: mohelmrabet/magento-frankenphp:php8.2-fp1.10.1-dev + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run PHPStan + uses: mohaelmrabet/magento-php-qa-action@v1 + with: + command: phpstan + composer-auth: ${{ format('{{"http-basic":{{"repo.magento.com":{{"username":"{0}","password":"{1}"}}}}}}', secrets.MAGENTO_AUTH_USERNAME, secrets.MAGENTO_AUTH_PASSWORD) }} + + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + container: + image: mohelmrabet/magento-frankenphp:php8.2-fp1.10.1-dev + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run PHP-CS-Fixer + uses: mohaelmrabet/magento-php-qa-action@v1 + with: + command: cs-fixer + composer-auth: ${{ format('{{"http-basic":{{"repo.magento.com":{{"username":"{0}","password":"{1}"}}}}}}', secrets.MAGENTO_AUTH_USERNAME, secrets.MAGENTO_AUTH_PASSWORD) }} + + unit-tests: + name: PHPUnit + runs-on: ubuntu-latest + + container: + image: mohelmrabet/magento-frankenphp:php8.2-fp1.10.1-dev + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run PHPUnit + uses: mohaelmrabet/magento-php-qa-action@v1 + with: + command: phpunit + composer-auth: ${{ format('{{"http-basic":{{"repo.magento.com":{{"username":"{0}","password":"{1}"}}}}}}', secrets.MAGENTO_AUTH_USERNAME, secrets.MAGENTO_AUTH_PASSWORD) }} + phpunit-path: ./Test/Unit diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..7540d31 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,13 @@ +in(__DIR__ . '/Console') + ->in(__DIR__ . '/Test'); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PSR12' => true, + ]) + ->setFinder($finder); diff --git a/.phpstan-bootstrap.php b/.phpstan-bootstrap.php new file mode 100644 index 0000000..3957bb0 --- /dev/null +++ b/.phpstan-bootstrap.php @@ -0,0 +1,18 @@ + Resolving `magento/module-developer` requires a valid Magento Marketplace +> `auth.json` (see the README's Installation section). + +## Running the tests + +```bash +composer test +``` + +or directly: + +```bash +vendor/bin/phpunit --testsuite unit +``` + +## Submitting changes + +1. Fork the repository and create a branch from `master`. +2. Keep changes focused — one topic per pull request. +3. Add or update unit tests for any behavior change in + `Console/DevTestsRunCommand.php`. +4. Make sure `composer test` passes before opening the PR. +5. Describe the *why* of the change in the PR description, not just the *what*. + +## Reporting bugs + +Open an issue at +https://github.com/CleatSquad/module-parallel-tests-plus/issues with the +Magento version, PHP version, the command you ran, and the full output. + +## Security issues + +Do not open a public issue for a security vulnerability — see +[SECURITY.md](SECURITY.md). diff --git a/Console/DevTestsRunCommand.php b/Console/DevTestsRunCommand.php index 3830fe9..3250914 100644 --- a/Console/DevTestsRunCommand.php +++ b/Console/DevTestsRunCommand.php @@ -1,4 +1,5 @@ **Note:** this package depends on `magento/module-developer`, resolved via +> `repo.magento.com`. Make sure your project has a valid Magento Marketplace +> `auth.json` configured, otherwise Composer will fail to resolve it. + Then upgrade Magento: ``` @@ -111,7 +114,9 @@ bin/magento dev:tests:run integration --processes 2 -c" testsuite/Magento/Catalo ## 🤝 Support & Contributions -Issues and pull requests are welcome. +Issues and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). +For security issues, see [SECURITY.md](SECURITY.md) instead of opening a +public issue. GitHub: https://github.com/CleatSquad/module-parallel-tests-plus diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..8fa5e0b --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +## Supported Versions + +Only the latest published `1.x` release is supported with security fixes. + +## Reporting a Vulnerability + +This module builds and runs a shell command (via `passthru()`) to invoke +ParaTest. If you find a way to make it execute unintended shell content, or +any other security issue, please report it privately rather than opening a +public GitHub issue: + +- Email: contact@cleatsquad.dev + +Please include a description of the issue, the steps to reproduce it, and +the Magento/PHP versions involved. We aim to acknowledge reports within a +few business days. diff --git a/Test/Unit/Console/DevTestsRunCommandTest.php b/Test/Unit/Console/DevTestsRunCommandTest.php index 9541823..4413810 100644 --- a/Test/Unit/Console/DevTestsRunCommandTest.php +++ b/Test/Unit/Console/DevTestsRunCommandTest.php @@ -1,4 +1,5 @@ + + + + Test/Unit + + + diff --git a/registration.php b/registration.php index 6e7ce59..a2a2cad 100644 --- a/registration.php +++ b/registration.php @@ -1,4 +1,5 @@