From b28ae9a8f209bc0787337a46aafa58f087dac17d Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 12:07:20 +0530 Subject: [PATCH 01/13] Update composer.json Updated php version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3c96fd1..9ddeb15 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": ">=7.4 <8.5", + "php": ">=7.4 <=8.5", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" }, From 4a4329aa964b24835083648b62c15109e05263ae Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 12:25:41 +0530 Subject: [PATCH 02/13] test_workflow.yml --- .github/workflow.yml | 177 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 .github/workflow.yml diff --git a/.github/workflow.yml b/.github/workflow.yml new file mode 100644 index 0000000..807cb52 --- /dev/null +++ b/.github/workflow.yml @@ -0,0 +1,177 @@ +Skip to content +php-lock +lock +Repository navigation +Code +Issues +1 + (1) +Pull requests +3 + (3) +Actions +Security +Insights +Unit +Unit #5720 +All jobs +Run details +Workflow file for this run +.github/workflows/test-unit.yml at 8ad61c1 +name: Unit + +on: + pull_request: + push: + schedule: + - cron: '0 0/2 * * *' + +jobs: + smoke-test: + name: Smoke + runs-on: ubuntu-latest + container: + image: ghcr.io/mvorisek/image-php:${{ matrix.php }} + strategy: + fail-fast: false + matrix: + php: ['latest'] + type: ['Phpunit'] + include: + - php: 'latest' + type: 'CodingStyle' + - php: 'latest' + type: 'StaticAnalysis' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure PHP + run: | + rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + php --version + - name: Install PHP dependencies + run: | + if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi + if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi + if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* --dev; fi + composer remove --no-interaction --no-update ext-lzf ext-memcached ext-sysvsem --dev + composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader + - name: "Run tests (only for Phpunit)" + if: startsWith(matrix.type, 'Phpunit') + run: | + vendor/bin/phpunit --exclude-group none --no-coverage --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) + - name: Check Coding Style (only for CodingStyle) + if: matrix.type == 'CodingStyle' + run: | + vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --verbose + composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock + - name: Run Static Analysis (only for StaticAnalysis) + if: matrix.type == 'StaticAnalysis' + run: | + echo "memory_limit = 2G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini + vendor/bin/phpstan analyse -v + unit-test: + name: Unit + runs-on: ubuntu-latest + container: + image: ghcr.io/mvorisek/image-php:${{ matrix.php }} + strategy: + fail-fast: false + matrix: + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + type: ['Phpunit', 'Phpunit Lowest'] + include: + - php: 'latest' + type: 'Phpunit Burn' + env: + LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == '8.4' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}" + services: + mysql: + image: mysql + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db + mariadb: + image: mariadb + options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db + postgres: + image: postgres:12-alpine + env: + POSTGRES_USER: test_user + POSTGRES_PASSWORD: test_pass + POSTGRES_DB: test_db + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + redis1: + image: redis:alpine + redis2: + image: redis:alpine + redis3: + image: redis:alpine + valkey1: + image: valkey/valkey:alpine + valkey2: + image: valkey/valkey:alpine + valkey3: + image: valkey/valkey:alpine + memcached: + image: memcached:alpine + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure PHP + run: | + install-php-extensions lzf memcached sysvsem + if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi + php --version + - name: Install PHP dependencies + run: | + if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi + if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi + if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* --dev; fi + if [ -n "$LOG_COVERAGE" ]; then composer require --no-interaction --no-install phpunit/phpcov; fi + composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader + if [ "${{ matrix.type }}" = "Phpunit Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader; fi + if [ "${{ matrix.type }}" = "Phpunit Burn" ]; then sed -i 's~public function runBare(): void~public function runBare(): void { gc_collect_cycles(); $memDiffs = array_fill(0, '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 64; else echo 16; fi)"', 0); $emitter = Event\\Facade::emitter(); for ($i = -1; $i < count($memDiffs); ++$i) { $this->_runBare(); if ($this->inIsolation) { $dispatcher = \\Closure::bind(static fn () => $emitter->dispatcher, null, Event\\DispatchingEmitter::class)(); if ($i === -1) { $dispatcherEvents = $dispatcher->flush()->asArray(); } else { $dispatcher->flush(); } foreach ($dispatcherEvents as $event) { $dispatcher->dispatch($event); } } gc_collect_cycles(); $mem = memory_get_usage(); if ($i !== -1) { $memDiffs[$i] = $mem - $memPrev; } $memPrev = $mem; rsort($memDiffs); if (array_sum($memDiffs) >= 4096 * 1024 || $memDiffs[2] > 0) { $e = new AssertionFailedError("Memory leak detected! (" . implode(" + ", array_map(static fn ($v) => number_format($v / 1024, 3, ".", " "), array_filter($memDiffs))) . " KB, " . ($i + 2) . " iterations)"); $this->status = TestStatus::failure($e->getMessage()); $emitter->testFailed($this->valueObjectForEvents(), Event\\Code\\ThrowableBuilder::from($e), Event\\Code\\ComparisonFailureBuilder::from($e)); $this->onNotSuccessfulTest($e); } } } private function _runBare(): void~' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare('; fi + - name: Init + run: | + php -r '(new PDO("mysql:host=mysql", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");' + php -r '(new PDO("mysql:host=mariadb", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");' + php -r '(new PDO("pgsql:host=postgres;dbname=test_db", "test_user", "test_pass"))->exec("ALTER ROLE test_user CONNECTION LIMIT 1");' + if [ -n "$LOG_COVERAGE" ]; then mkdir coverage; fi + - name: "Run tests" + env: + MYSQL_DSN: "mysql:host=mysql;dbname=test_db" + MYSQL_USER: test_user + MYSQL_PASSWORD: test_pass + PGSQL_DSN: "pgsql:host=postgres;dbname=test_db" + PGSQL_USER: test_user + PGSQL_PASSWORD: test_pass + REDIS_URIS: "redis://redis1,redis://redis2,redis://redis3" + MEMCACHE_HOST: memcached + run: | + php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) + - name: "Run tests /w MariaDB and Valkey (only for cron)" + if: (success() || failure()) && github.event_name == 'schedule' + env: + MYSQL_DSN: "mysql:host=mariadb;dbname=test_db" + MYSQL_USER: test_user + MYSQL_PASSWORD: test_pass + PGSQL_DSN: "pgsql:host=postgres;dbname=test_db" + PGSQL_USER: test_user + PGSQL_PASSWORD: test_pass + REDIS_URIS: "redis://valkey1,redis://valkey2,redis://valkey3" + MEMCACHE_HOST: memcached + run: | + php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) + - name: Upload coverage logs 1/2 (only for coverage) + if: env.LOG_COVERAGE + run: | + ls -l coverage | wc -l + php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml + - name: Upload coverage logs 2/2 (only for coverage) + if: env.LOG_COVERAGE + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + files: coverage/merged.xml From 01af359115589ab75893e0b51cf805a7dc6018e8 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 12:30:35 +0530 Subject: [PATCH 03/13] Update workflow.yml Updated PHP version matrix --- .github/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow.yml b/.github/workflow.yml index 807cb52..1d8343b 100644 --- a/.github/workflow.yml +++ b/.github/workflow.yml @@ -79,7 +79,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4','8.5'] type: ['Phpunit', 'Phpunit Lowest'] include: - php: 'latest' From dabbcb10fa45f198d7f0a7a81595ec6e897b4f29 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 12:38:25 +0530 Subject: [PATCH 04/13] Create workflow.yml --- .github/workflows/workflow.yml | 168 +++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..c9f8bc3 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,168 @@ +name: Unit + +on: + pull_request: + push: + schedule: + - cron: '0 0/2 * * *' + +jobs: + smoke-test: + name: Smoke + runs-on: ubuntu-latest + container: + image: ghcr.io/mvorisek/image-php:${{ matrix.php }} + strategy: + fail-fast: false + matrix: + php: ['latest'] + type: ['Phpunit'] + include: + - php: 'latest' + type: 'CodingStyle' + - php: 'latest' + type: 'StaticAnalysis' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure PHP + run: | + rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + php --version + + - name: Install PHP dependencies + run: | + if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi + if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi + if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* --dev; fi + composer remove --no-interaction --no-update ext-lzf ext-memcached ext-sysvsem --dev + composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader + + - name: "Run tests (only for Phpunit)" + if: startsWith(matrix.type, 'Phpunit') + run: | + vendor/bin/phpunit --exclude-group none --no-coverage --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) + + - name: Check Coding Style (only for CodingStyle) + if: matrix.type == 'CodingStyle' + run: | + vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --verbose + composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock + + - name: Run Static Analysis (only for StaticAnalysis) + if: matrix.type == 'StaticAnalysis' + run: | + echo "memory_limit = 2G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini + vendor/bin/phpstan analyse -v + + unit-test: + name: Unit + runs-on: ubuntu-latest + container: + image: ghcr.io/mvorisek/image-php:${{ matrix.php }} + strategy: + fail-fast: false + matrix: + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + type: ['Phpunit', 'Phpunit Lowest'] + include: + - php: 'latest' + type: 'Phpunit Burn' + env: + LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php >= '8.4' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}" + services: + mysql: + image: mysql + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db + mariadb: + image: mariadb + options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db + postgres: + image: postgres:12-alpine + env: + POSTGRES_USER: test_user + POSTGRES_PASSWORD: test_pass + POSTGRES_DB: test_db + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + redis1: + image: redis:alpine + redis2: + image: redis:alpine + redis3: + image: redis:alpine + valkey1: + image: valkey/valkey:alpine + valkey2: + image: valkey/valkey:alpine + valkey3: + image: valkey/valkey:alpine + memcached: + image: memcached:alpine + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure PHP + run: | + install-php-extensions lzf memcached sysvsem + if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi + php --version + + - name: Install PHP dependencies + run: | + if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi + if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi + if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* --dev; fi + if [ -n "$LOG_COVERAGE" ]; then composer require --no-interaction --no-install phpunit/phpcov; fi + composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader + if [ "${{ matrix.type }}" = "Phpunit Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader; fi + if [ "${{ matrix.type }}" = "Phpunit Burn" ]; then sed -i 's~public function runBare(): void~public function runBare(): void { gc_collect_cycles(); $memDiffs = array_fill(0, '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 64; else echo 16; fi)"', 0); $emitter = Event\\Facade::emitter(); for ($i = -1; $i < count($memDiffs); ++$i) { $this->_runBare(); if ($this->inIsolation) { $dispatcher = \\Closure::bind(static fn () => $emitter->dispatcher, null, Event\\DispatchingEmitter::class)(); if ($i === -1) { $dispatcherEvents = $dispatcher->flush()->asArray(); } else { $dispatcher->flush(); } foreach ($dispatcherEvents as $event) { $dispatcher->dispatch($event); } } gc_collect_cycles(); $mem = memory_get_usage(); if ($i !== -1) { $memDiffs[$i] = $mem - $memPrev; } $memPrev = $mem; rsort($memDiffs); if (array_sum($memDiffs) >= 4096 * 1024 || $memDiffs[2] > 0) { $e = new AssertionFailedError("Memory leak detected! (" . implode(" + ", array_map(static fn ($v) => number_format($v / 1024, 3, ".", " "), array_filter($memDiffs))) . " KB, " . ($i + 2) . " iterations)"); $this->status = TestStatus::failure($e->getMessage()); $emitter->testFailed($this->valueObjectForEvents(), Event\\Code\\ThrowableBuilder::from($e), Event\\Code\\ComparisonFailureBuilder::from($e)); $this->onNotSuccessfulTest($e); } } } private function _runBare(): void~' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare('; fi + + - name: Init + run: | + php -r '(new PDO("mysql:host=mysql", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");' + php -r '(new PDO("mysql:host=mariadb", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");' + php -r '(new PDO("pgsql:host=postgres;dbname=test_db", "test_user", "test_pass"))->exec("ALTER ROLE test_user CONNECTION LIMIT 1");' + if [ -n "$LOG_COVERAGE" ]; then mkdir coverage; fi + + - name: "Run tests" + env: + MYSQL_DSN: "mysql:host=mysql;dbname=test_db" + MYSQL_USER: test_user + MYSQL_PASSWORD: test_pass + PGSQL_DSN: "pgsql:host=postgres;dbname=test_db" + PGSQL_USER: test_user + PGSQL_PASSWORD: test_pass + REDIS_URIS: "redis://redis1,redis://redis2,redis://redis3" + MEMCACHE_HOST: memcached + run: | + php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) + + - name: "Run tests /w MariaDB and Valkey (only for cron)" + if: (success() || failure()) && github.event_name == 'schedule' + env: + MYSQL_DSN: "mysql:host=mariadb;dbname=test_db" + MYSQL_USER: test_user + MYSQL_PASSWORD: test_pass + PGSQL_DSN: "pgsql:host=postgres;dbname=test_db" + PGSQL_USER: test_user + PGSQL_PASSWORD: test_pass + REDIS_URIS: "redis://valkey1,redis://valkey2,redis://valkey3" + MEMCACHE_HOST: memcached + run: | + php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) + + - name: Upload coverage logs 1/2 (only for coverage) + if: env.LOG_COVERAGE + run: | + ls -l coverage | wc -l + php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml + + - name: Upload coverage logs 2/2 (only for coverage) + if: env.LOG_COVERAGE + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + files: coverage/merged.xml From 6c169e2b22a5b9b7dd578e95276143bf195dc58b Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:01:13 +0530 Subject: [PATCH 05/13] Updated composer.json to support php8.5 Updated composer.json to support php8.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9ddeb15..643e026 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": ">=7.4 <=8.5", + "php": ">=7.4 <= ^8.4", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" }, From 71df896de865da1c6a483ae73b7e62ca217ddbe8 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:01:49 +0530 Subject: [PATCH 06/13] Update composer.json to support 8.5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 643e026..95616e5 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": ">=7.4 <= ^8.4", + "php": ">=7.4 <= ^8.5", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" }, From 55d5b2ee4fefa87d2f58a6e6a0cee1dd6c793d75 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:09:02 +0530 Subject: [PATCH 07/13] Update composer.json Updated Composer Json with PHP 85 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 95616e5..3f5b19e 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": ">=7.4 <= ^8.5", + "php": "7.4 || ^8.5", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" }, From 0263dcf83097a3c88a4d82c56bd7f5a7e0b97688 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:12:07 +0530 Subject: [PATCH 08/13] Update workflow.yml --- .github/workflow.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflow.yml b/.github/workflow.yml index 1d8343b..6ec3dec 100644 --- a/.github/workflow.yml +++ b/.github/workflow.yml @@ -1,23 +1,3 @@ -Skip to content -php-lock -lock -Repository navigation -Code -Issues -1 - (1) -Pull requests -3 - (3) -Actions -Security -Insights -Unit -Unit #5720 -All jobs -Run details -Workflow file for this run -.github/workflows/test-unit.yml at 8ad61c1 name: Unit on: From 23a35ab2c49640e95ee6b72b2944b7eda39e6768 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:12:43 +0530 Subject: [PATCH 09/13] Delete .github/workflows/workflow.yml --- .github/workflows/workflow.yml | 168 --------------------------------- 1 file changed, 168 deletions(-) delete mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml deleted file mode 100644 index c9f8bc3..0000000 --- a/.github/workflows/workflow.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: Unit - -on: - pull_request: - push: - schedule: - - cron: '0 0/2 * * *' - -jobs: - smoke-test: - name: Smoke - runs-on: ubuntu-latest - container: - image: ghcr.io/mvorisek/image-php:${{ matrix.php }} - strategy: - fail-fast: false - matrix: - php: ['latest'] - type: ['Phpunit'] - include: - - php: 'latest' - type: 'CodingStyle' - - php: 'latest' - type: 'StaticAnalysis' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure PHP - run: | - rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - php --version - - - name: Install PHP dependencies - run: | - if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi - if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi - if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* --dev; fi - composer remove --no-interaction --no-update ext-lzf ext-memcached ext-sysvsem --dev - composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader - - - name: "Run tests (only for Phpunit)" - if: startsWith(matrix.type, 'Phpunit') - run: | - vendor/bin/phpunit --exclude-group none --no-coverage --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) - - - name: Check Coding Style (only for CodingStyle) - if: matrix.type == 'CodingStyle' - run: | - vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --verbose - composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock - - - name: Run Static Analysis (only for StaticAnalysis) - if: matrix.type == 'StaticAnalysis' - run: | - echo "memory_limit = 2G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini - vendor/bin/phpstan analyse -v - - unit-test: - name: Unit - runs-on: ubuntu-latest - container: - image: ghcr.io/mvorisek/image-php:${{ matrix.php }} - strategy: - fail-fast: false - matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] - type: ['Phpunit', 'Phpunit Lowest'] - include: - - php: 'latest' - type: 'Phpunit Burn' - env: - LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php >= '8.4' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}" - services: - mysql: - image: mysql - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db - mariadb: - image: mariadb - options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=test_pass_root -e MYSQL_USER=test_user -e MYSQL_PASSWORD=test_pass -e MYSQL_DATABASE=test_db - postgres: - image: postgres:12-alpine - env: - POSTGRES_USER: test_user - POSTGRES_PASSWORD: test_pass - POSTGRES_DB: test_db - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - redis1: - image: redis:alpine - redis2: - image: redis:alpine - redis3: - image: redis:alpine - valkey1: - image: valkey/valkey:alpine - valkey2: - image: valkey/valkey:alpine - valkey3: - image: valkey/valkey:alpine - memcached: - image: memcached:alpine - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure PHP - run: | - install-php-extensions lzf memcached sysvsem - if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi - php --version - - - name: Install PHP dependencies - run: | - if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi - if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi - if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* --dev; fi - if [ -n "$LOG_COVERAGE" ]; then composer require --no-interaction --no-install phpunit/phpcov; fi - composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader - if [ "${{ matrix.type }}" = "Phpunit Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader; fi - if [ "${{ matrix.type }}" = "Phpunit Burn" ]; then sed -i 's~public function runBare(): void~public function runBare(): void { gc_collect_cycles(); $memDiffs = array_fill(0, '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 64; else echo 16; fi)"', 0); $emitter = Event\\Facade::emitter(); for ($i = -1; $i < count($memDiffs); ++$i) { $this->_runBare(); if ($this->inIsolation) { $dispatcher = \\Closure::bind(static fn () => $emitter->dispatcher, null, Event\\DispatchingEmitter::class)(); if ($i === -1) { $dispatcherEvents = $dispatcher->flush()->asArray(); } else { $dispatcher->flush(); } foreach ($dispatcherEvents as $event) { $dispatcher->dispatch($event); } } gc_collect_cycles(); $mem = memory_get_usage(); if ($i !== -1) { $memDiffs[$i] = $mem - $memPrev; } $memPrev = $mem; rsort($memDiffs); if (array_sum($memDiffs) >= 4096 * 1024 || $memDiffs[2] > 0) { $e = new AssertionFailedError("Memory leak detected! (" . implode(" + ", array_map(static fn ($v) => number_format($v / 1024, 3, ".", " "), array_filter($memDiffs))) . " KB, " . ($i + 2) . " iterations)"); $this->status = TestStatus::failure($e->getMessage()); $emitter->testFailed($this->valueObjectForEvents(), Event\\Code\\ThrowableBuilder::from($e), Event\\Code\\ComparisonFailureBuilder::from($e)); $this->onNotSuccessfulTest($e); } } } private function _runBare(): void~' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare('; fi - - - name: Init - run: | - php -r '(new PDO("mysql:host=mysql", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");' - php -r '(new PDO("mysql:host=mariadb", "root", "test_pass_root"))->exec("ALTER USER '"'"'test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 15");' - php -r '(new PDO("pgsql:host=postgres;dbname=test_db", "test_user", "test_pass"))->exec("ALTER ROLE test_user CONNECTION LIMIT 1");' - if [ -n "$LOG_COVERAGE" ]; then mkdir coverage; fi - - - name: "Run tests" - env: - MYSQL_DSN: "mysql:host=mysql;dbname=test_db" - MYSQL_USER: test_user - MYSQL_PASSWORD: test_pass - PGSQL_DSN: "pgsql:host=postgres;dbname=test_db" - PGSQL_USER: test_user - PGSQL_PASSWORD: test_pass - REDIS_URIS: "redis://redis1,redis://redis2,redis://redis3" - MEMCACHE_HOST: memcached - run: | - php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) - - - name: "Run tests /w MariaDB and Valkey (only for cron)" - if: (success() || failure()) && github.event_name == 'schedule' - env: - MYSQL_DSN: "mysql:host=mariadb;dbname=test_db" - MYSQL_USER: test_user - MYSQL_PASSWORD: test_pass - PGSQL_DSN: "pgsql:host=postgres;dbname=test_db" - PGSQL_USER: test_user - PGSQL_PASSWORD: test_pass - REDIS_URIS: "redis://valkey1,redis://valkey2,redis://valkey3" - MEMCACHE_HOST: memcached - run: | - php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-phpunit-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) - - - name: Upload coverage logs 1/2 (only for coverage) - if: env.LOG_COVERAGE - run: | - ls -l coverage | wc -l - php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml - - - name: Upload coverage logs 2/2 (only for coverage) - if: env.LOG_COVERAGE - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: coverage/merged.xml From b37e49cbbe1742d5504ee7d36a1e9899fc406207 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:13:21 +0530 Subject: [PATCH 10/13] Update test-unit.yml --- .github/workflows/test-unit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index df0c79f..8bd57de 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -64,7 +64,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] type: ['Phpunit', 'Phpunit Lowest'] include: - php: 'latest' From c9a2cbcb05ce9f96c51abe2da0272271a0615d80 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:29:38 +0530 Subject: [PATCH 11/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3f5b19e..e14ac4e 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": "7.4 || ^8.5", + "php": ">=7.4 <=8.6", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" }, From 23c345d989837a8057eceb4a40cfe8c2bec4d08a Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:35:24 +0530 Subject: [PATCH 12/13] Update composer.json - php85 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e14ac4e..618cecd 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": ">=7.4 <=8.6", + "php": ">=7.4 <8.6", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" }, From 044a97bb1752ed60fe2dae08b0f0de594c977053 Mon Sep 17 00:00:00 2001 From: Vedavith Ravula Date: Fri, 23 Jan 2026 14:39:27 +0530 Subject: [PATCH 13/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 618cecd..5bf0d95 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ ], "homepage": "https://github.com/malkusch/lock", "require": { - "php": ">=7.4 <8.6", + "php": ">=7.4 <8.6", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/polyfill-php80": "^1.28" },