Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk authored Dec 17, 2024
2 parents 6dc0248 + cc35329 commit e8479ea
Show file tree
Hide file tree
Showing 275 changed files with 1,763 additions and 3,094 deletions.
47 changes: 31 additions & 16 deletions .github/workflows/run-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,21 @@ jobs:
test:
name: PHP${{ matrix.php }}${{ matrix.extensions-suffix }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout-minutes }}
timeout-minutes: ${{ inputs.test-timeout }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
php: [ 8.1, 8.2, 8.3 ]
os: [ ubuntu-latest, windows-latest ]
php: [ 8.1, 8.2, 8.3, 8.4 ]
os: [ ubuntu-latest ]
extensions-suffix: [ '', ', protobuf' ]
dependencies: [ lowest , highest ]
timeout-minutes: [ '${{ inputs.test-timeout }}' ]
exclude:
- os: windows-latest
php: 8.2
include:
- os: windows-latest
extensions-suffix: ', protobuf'
- os: windows-latest
php: 8.3
php: 8.1
dependencies: highest
steps:
- name: Set Git To Use LF
run: |
Expand All @@ -82,6 +79,10 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Download CPX (PHP 8.4)
if: inputs.download-binaries == true && matrix.php == '8.4'
run: composer global require cpx/cpx

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -96,23 +97,37 @@ jobs:
php-${{ matrix.php }}-${{ matrix.os }}-composer-
- name: Install lowest dependencies from composer.json
if: matrix.dependencies == 'lowest'
if: matrix.dependencies == 'lowest' && matrix.php != '8.4'
run: composer update --no-interaction --no-progress --prefer-lowest

- name: Install lowest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
if: matrix.dependencies == 'lowest' && matrix.php == '8.4'
run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php


- name: Validate lowest dependencies
if: matrix.dependencies == 'lowest'
if: matrix.dependencies == 'lowest' && matrix.php == '8.1'
env:
COMPOSER_POOL_OPTIMIZER: 0
run: vendor/bin/validate-prefer-lowest


- name: Install highest dependencies from composer.json
if: matrix.dependencies == 'highest'
if: matrix.dependencies == 'highest' && matrix.php != '8.4'
run: composer update --no-interaction --no-progress

- name: Download RoadRunner
if: inputs.download-binaries == true
run: |
vendor/bin/dload get --no-interaction -vv
- name: Install highest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
if: matrix.dependencies == 'highest' && matrix.php == '8.4'
run: composer update --no-interaction --no-progress --ignore-platform-req php


- name: Download binaries
if: inputs.download-binaries == true && matrix.php != '8.4'
run: composer get:binaries

- name: Download binaries (PHP 8.4)
if: inputs.download-binaries == true && matrix.php == '8.4'
run: cpx internal/dload get --no-interaction

- name: Run tests
run: ${{ inputs.test-command }}
40 changes: 39 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,43 @@ jobs:
- name: Install Composer Dependencies
run: composer install --prefer-dist --no-interaction

- name: Run Tests
- name: 🔍 Run Tests
run: vendor/bin/psalm

arch:
name: Architecture tests
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
php: [8.3]
os: [ubuntu-latest]
steps:
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom

- name: Check Out Code
uses: actions/checkout@v4
with:
fetch-depth: 1

- 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@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer-

- name: Install Composer Dependencies
run: composer install --prefer-dist --no-interaction

- name: 🔍 Run Tests
run: composer test:arch
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
"roadrunner-php/roadrunner-api-dto": "^1.9.0",
"roadrunner-php/version-checker": "^1.0",
"spiral/attributes": "^3.1.6",
"spiral/roadrunner": "^2024.1",
"spiral/roadrunner": "^2024.3",
"spiral/roadrunner-cli": "^2.5",
"spiral/roadrunner-kv": "^4.2",
"spiral/roadrunner-worker": "^3.5",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0",
"symfony/process": "^5.4 || ^6.0 || ^7.0"
},
"autoload": {
Expand All @@ -61,7 +61,7 @@
"phpunit/phpunit": "^10.5",
"spiral/code-style": "~2.1.2",
"spiral/core": "^3.13",
"symfony/var-dumper": "^6.0 || ^7.0",
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
"vimeo/psalm": "^4.30 || ^5.4"
},
"autoload-dev": {
Expand All @@ -81,12 +81,14 @@
},
"scripts": {
"post-update-cmd": "Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate",
"get:binaries": "dload get --no-interaction -vv",
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
"cs:fix": "php-cs-fixer fix -v",
"psalm": "psalm",
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
"test:unit": "phpunit --testsuite=Unit --color=always --testdox",
"test:func": "phpunit --testsuite=Functional --color=always --testdox",
"test:arch": "phpunit --testsuite=Arch --color=always --testdox",
"test:accept": "phpunit --testsuite=Acceptance --color=always --testdox"
},
"extra": {
Expand Down
9 changes: 9 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@
stopOnFailure="false"
stopOnError="false"
stderr="true"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<testsuites>
<testsuite name="Acceptance">
<directory suffix="Test.php">tests/Acceptance/Harness</directory>
</testsuite>
<testsuite name="Arch">
<directory suffix="Test.php">tests/Arch</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="TestCase.php">tests/Unit</directory>
</testsuite>
Expand Down
41 changes: 31 additions & 10 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<code><![CDATA[$workflowType]]></code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Client/Schedule/Spec/ScheduleSpec.php">
<DeprecatedProperty>
<code><![CDATA[$this->excludeCalendarList]]></code>
<code><![CDATA[$this->excludeCalendarList]]></code>
</DeprecatedProperty>
</file>
<file src="src/Client/Update/UpdateHandle.php">
<PossiblyNullArgument>
<code><![CDATA[$result->getSuccess()]]></code>
Expand All @@ -117,6 +123,7 @@
<file src="src/Client/WorkflowClient.php">
<ArgumentTypeCoercion>
<code><![CDATA[$counter]]></code>
<code><![CDATA[$signal]]></code>
<code><![CDATA[$workflowType]]></code>
<code><![CDATA[$workflowType]]></code>
</ArgumentTypeCoercion>
Expand All @@ -142,13 +149,24 @@
<LessSpecificReturnStatement>
<code><![CDATA[new self($serviceClient, $options, $converter, $interceptorProvider)]]></code>
</LessSpecificReturnStatement>
<MissingParamType>
<code><![CDATA[$workflow]]></code>
</MissingParamType>
<MoreSpecificReturnType>
<code><![CDATA[static]]></code>
</MoreSpecificReturnType>
<RedundantFunctionCall>
<code><![CDATA[\sprintf]]></code>
<code><![CDATA[\sprintf]]></code>
</RedundantFunctionCall>
<TypeDoesNotContainType>
<code><![CDATA[$signal === '']]></code>
</TypeDoesNotContainType>
</file>
<file src="src/Client/WorkflowClientInterface.php">
<MissingParamType>
<code><![CDATA[$workflow]]></code>
</MissingParamType>
</file>
<file src="src/Client/WorkflowOptions.php">
<ImpureMethodCall>
Expand Down Expand Up @@ -378,6 +396,14 @@
</MissingParamType>
</file>
<file src="src/Internal/Client/WorkflowStarter.php">
<InvalidArgument>
<code><![CDATA[0]]></code>
<code><![CDATA[1]]></code>
<code><![CDATA[1]]></code>
</InvalidArgument>
<MissingTemplateParam>
<code><![CDATA[$fails]]></code>
</MissingTemplateParam>
<PossiblyNullArgument>
<code><![CDATA[$options->retryOptions ? $options->retryOptions->toWorkflowRetryPolicy() : null]]></code>
<code><![CDATA[$options->toMemo($this->converter)]]></code>
Expand All @@ -389,6 +415,9 @@
<RedundantConditionGivenDocblockType>
<code><![CDATA[$delay !== null]]></code>
</RedundantConditionGivenDocblockType>
<UndefinedInterfaceMethod>
<code><![CDATA[toHeader]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="src/Internal/Client/WorkflowStub.php">
<PossiblyInvalidArgument>
Expand All @@ -399,6 +428,7 @@
<code><![CDATA[$attr->getFailure()]]></code>
<code><![CDATA[$attr->getResult()]]></code>
<code><![CDATA[$input->workflowType]]></code>
<code><![CDATA[$input->workflowType]]></code>
<code><![CDATA[$result->getQueryResult()]]></code>
<code><![CDATA[$this->execution]]></code>
<code><![CDATA[$this->execution]]></code>
Expand Down Expand Up @@ -508,7 +538,6 @@
</file>
<file src="src/Internal/Declaration/Reader/WorkflowReader.php">
<ArgumentTypeCoercion>
<code><![CDATA[$class]]></code>
<code><![CDATA[$contextualRetry]]></code>
<code><![CDATA[$method]]></code>
<code><![CDATA[$name]]></code>
Expand Down Expand Up @@ -1218,10 +1247,6 @@
<InvalidOperand>
<code><![CDATA[$promisesOrValues]]></code>
</InvalidOperand>
<MissingParamType>
<code><![CDATA[$promiseOrValue]]></code>
<code><![CDATA[$promiseOrValue]]></code>
</MissingParamType>
<TooManyArguments>
<code><![CDATA[$reduce($c, $value, $i++, $total)]]></code>
</TooManyArguments>
Expand Down Expand Up @@ -1367,11 +1392,6 @@
<code><![CDATA[$method]]></code>
</ArgumentTypeCoercion>
</file>
<file src="src/Worker/Transport/RPCConnectionInterface.php">
<MissingParamType>
<code><![CDATA[$payload]]></code>
</MissingParamType>
</file>
<file src="src/Worker/Transport/RoadRunner.php">
<ArgumentTypeCoercion>
<code><![CDATA[$env->getRelayAddress()]]></code>
Expand Down Expand Up @@ -1457,6 +1477,7 @@
<code><![CDATA[new static(
$converter ?? DataConverter::createDefault(),
$rpc ?? Goridge::create(),
$credentials ?? ServiceCredentials::create(),
)]]></code>
</UnsafeInstantiation>
</file>
Expand Down
3 changes: 0 additions & 3 deletions src/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ final class Activity extends Facade
/**
* Returns information about current activity execution.
*
* @return ActivityInfo
* @throws OutOfContextException in the absence of the activity execution context.
*/
public static function getInfo(): ActivityInfo
Expand All @@ -53,7 +52,6 @@ public static function getInfo(): ActivityInfo
* }
* ```
*
* @return ValuesInterface
* @throws OutOfContextException in the absence of the activity execution context.
*/
public static function getInput(): ValuesInterface
Expand All @@ -69,7 +67,6 @@ public static function getInput(): ValuesInterface
*
* This method returns **true** if the first argument has been passed to the {@see Activity::heartbeat()} method.
*
* @return bool
* @throws OutOfContextException in the absence of the activity execution context.
*/
public static function hasHeartbeatDetails(): bool
Expand Down
4 changes: 0 additions & 4 deletions src/Activity/ActivityContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface ActivityContextInterface
*
* @see Activity::getInfo()
*
* @return ActivityInfo
*/
public function getInfo(): ActivityInfo;

Expand All @@ -31,7 +30,6 @@ public function getInfo(): ActivityInfo;
*
* @see Activity::getInput()
*
* @return ValuesInterface
*/
public function getInput(): ValuesInterface;

Expand All @@ -40,7 +38,6 @@ public function getInput(): ValuesInterface;
*
* @see Activity::hasHeartbeatDetails()
*
* @return bool
*/
public function hasHeartbeatDetails(): bool;

Expand All @@ -59,7 +56,6 @@ public function getHeartbeatDetails($type = null);
*
* @see Activity::doNotCompleteOnReturn()
*
* @return void
*/
public function doNotCompleteOnReturn(): void;

Expand Down
Loading

0 comments on commit e8479ea

Please sign in to comment.