Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ jobs:
fi
echo "java_latest=$java_latest" >> "$GITHUB_OUTPUT"

# Temporary: harness/php/composer.json pins the SDK to a branch, so an
# empty version keeps that pin. Restore the lookup once the SDK ships.
php_latest="$INPUT_PHP_SDK_VERSION"
if [ -z "$php_latest" ]; then
php_latest=$(./temporal-features latest-sdk-version --lang php)
echo "Derived latest PHP SDK release version: $php_latest"
fi
echo "php_latest=$php_latest" >> "$GITHUB_OUTPUT"

python_latest="$INPUT_PYTHON_SDK_VERSION"
Expand Down Expand Up @@ -374,7 +372,7 @@ jobs:
go-ver: 'v${{ needs.build-go.outputs.go_latest }}'
ts-ver: 'v${{ needs.build-go.outputs.typescript_latest }}'
java-ver: 'v${{ needs.build-go.outputs.java_latest }}'
php-ver: 'v${{ needs.build-go.outputs.php_latest }}'
php-ver: ${{ needs.build-go.outputs.php_latest && format('v{0}', needs.build-go.outputs.php_latest) || '' }}
py-ver: 'v${{ needs.build-go.outputs.python_latest }}'
cs-ver: 'v${{ needs.build-go.outputs.csharp_latest }}'
rb-ver: 'v${{ needs.build-go.outputs.ruby_latest }}'
Expand Down
55 changes: 55 additions & 0 deletions features/activity/standalone/feature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

declare(strict_types=1);

namespace Harness\Feature\Activity\Standalone;

use Harness\Attribute\Check;
use Harness\Runtime\Feature;
use Harness\Runtime\State;
use Ramsey\Uuid\Uuid;
use Temporal\Activity\ActivityInterface;
use Temporal\Activity\ActivityMethod;
use Temporal\Client\Activity\ActivityExecutionStatus;
use Temporal\Client\Activity\StartActivityOptions;
use Temporal\Client\ActivityClient;
use Temporal\Client\ClientOptions;
use Temporal\Client\GRPC\ServiceClientInterface;
use Webmozart\Assert\Assert;

#[ActivityInterface]
class FeatureActivity
{
#[ActivityMethod('echo')]
public function echo(string $value): string
{
return $value;
}
}

class FeatureChecker
{
#[Check]
public static function check(
ServiceClientInterface $serviceClient,
Feature $feature,
State $runtime,
): void {
$client = ActivityClient::create(
serviceClient: $serviceClient,
options: (new ClientOptions())->withNamespace($runtime->namespace),
);

$handle = $client->start(
'echo',
StartActivityOptions::new()
->withId(Uuid::uuid4()->toString())
->withTaskQueue($feature->taskQueue)
->withStartToCloseTimeout('1 minute'),
'hello',
);

Assert::same($handle->getResult('string'), 'hello');
Assert::same($handle->describe()->info->status, ActivityExecutionStatus::Completed);
}
}
10 changes: 8 additions & 2 deletions harness/php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"buggregator/trap": "^1.9",
"spiral/core": "^3.13",
"symfony/process": ">=6.4",
"temporal/sdk": "^2.16.0",
"temporal/sdk": "dev-feature/standalone-activities as 2.21.0",
"webmozart/assert": "^1.11"
},
"autoload": {
Expand All @@ -21,5 +21,11 @@
"rr-get": "rr get"
},
"prefer-stable": true,
"minimum-stability": "dev"
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/temporalio/sdk-php"
}
]
}
Loading