Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gh Actions #29

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "CI"

on:
pull_request: ~
push:
branches:
- 'master'

env:
fail-fast: true
TZ: "UTC"

jobs:
phpunit:
name: "PHPUnit (${{ matrix.php-version }})"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- '7.3'
- '7.4'

steps:
-
name: "Checkout code"
uses: "actions/checkout@v2"
-
name: "Start container"
run: docker-compose up -d
-
name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2

-
name: "Composer install"
uses: "ramsey/composer-install@v1"

-
name: "Run PHPUnit"
run: "composer phpunit"

-
name: "Run Behat"
run: "composer behat"
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"spryker/propel": "^3.0",
"spryker/console": "^4.0",
"guzzlehttp/guzzle": "^6.0",
"spryker/rabbit-mq": "^2.0",
"spryker/rabbit-mq": "^2.15",
"symfony/var-dumper": "^4.0|^5.0",
"spryker/zed-request": "^3.8"
},
"require-dev": {
"phpstan/phpstan": "^1.2",
"phpunit/phpunit": "^7.0",
"propel/propel": "^2.0@alpha",
"behat/behat": "^3.5",
"spryker-sdk/phpstan-spryker": "^1.0@dev",
"roave/behat-psr11extension": "^1.0",
"webmozart/path-util": "^2.0",
"spryker/code-sniffer": "dev-master",
Expand Down
5 changes: 3 additions & 2 deletions tests/Acceptance/Context/QueueContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
use Behat\Gherkin\Node\PyStringNode;
use Generated\Shared\Transfer\QueueSendMessageTransfer;
use Generated\Shared\Transfer\RabbitMqOptionTransfer;
use PhpAmqpLib\Connection\AMQPConnection;
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Connection\AbstractConnection;
use PhpAmqpLib\Message\AMQPMessage;
use Spryker\Client\RabbitMq\RabbitMqClientInterface;

Expand All @@ -18,7 +19,7 @@ class QueueContext implements Context
private $connection;


public function __construct(AMQPConnection $connection)
public function __construct(AMQPStreamConnection $connection)
{
$this->connection = $connection;
}
Expand Down
6 changes: 4 additions & 2 deletions tests/TestContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Inviqa\SprykerDebug\Tests\Support\ApplicationBuilder;
use Inviqa\SprykerDebug\Tests\Support\Workspace\Workspace;
use PhpAmqpLib\Connection\AMQPConnection;
use PhpAmqpLib\Connection\AMQPStreamConnection;
use Psr\Container\ContainerInterface;
use Spryker\Client\RabbitMq\RabbitMqClient;
use Spryker\Client\RabbitMq\RabbitMqClientInterface;
Expand Down Expand Up @@ -63,9 +64,10 @@ private function registerRabbit(): void
$this[RabbitMqClientInterface::class] = $this->share(function () {
return new RabbitMqClient();
});
$this[AMQPConnection::class] = $this->share(function () {

$this[AMQPStreamConnection::class] = $this->share(function () {
$this->initApplication();
return new AMQPConnection(
return new AMQPStreamConnection(
Config::get(RabbitMqEnv::RABBITMQ_HOST),
Config::get(RabbitMqEnv::RABBITMQ_PORT),
Config::get(RabbitMqEnv::RABBITMQ_USERNAME),
Expand Down