Skip to content

Commit

Permalink
Merge pull request #3 from mangoweb-sylius/pr/travis
Browse files Browse the repository at this point in the history
Travis CI
  • Loading branch information
Johan Hornof authored Jul 4, 2019
2 parents f158205 + c5d0248 commit 9ddaf55
Show file tree
Hide file tree
Showing 89 changed files with 693 additions and 971 deletions.
52 changes: 15 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,43 @@ cache:

env:
global:
- APP_ENV=test
- SYLIUS_CACHE_DIR=$HOME/.sylius-cache
- SYLIUS_BUILD_DIR=etc/build
matrix:
- SYMFONY_VERSION="3.4.*"
- SYMFONY_VERSION="4.1.*"

matrix:
include:
- env:
- SYLIUS_VERSION="1.4.*"
- env:
- SYLIUS_VERSION="1.5.*"

before_install:
- phpenv config-rm xdebug.ini
- echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- mkdir -p "${SYLIUS_CACHE_DIR}"

install:
- composer require "symfony/symfony:${SYMFONY_VERSION}" --no-interaction --no-update
- composer install --no-interaction --prefer-dist
- composer require "sylius/sylius:${SYLIUS_VERSION}" --no-interaction --no-update
- composer update --no-interaction --prefer-dist
- (cd tests/Application && yarn install)

before_script:
- (cd tests/Application && bin/console doctrine:database:create --env=test -vvv)
- (cd tests/Application && bin/console doctrine:schema:create --env=test -vvv)
- (cd tests/Application && bin/console assets:install web --env=test -vvv)
# - (cd tests/Application && bin/console assets:install web --env=test -vvv)
- (cd tests/Application && bin/console cache:warmup --env=test -vvv)
- (cd tests/Application && yarn build)

# Configure display
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16
- export DISPLAY=:99

# Download and configure ChromeDriver
- |
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
unzip chromedriver.zip
chmod +x chromedriver
mv chromedriver $SYLIUS_CACHE_DIR
fi
# Run ChromeDriver
- $SYLIUS_CACHE_DIR/chromedriver > /dev/null 2>&1 &

# Download and configure Selenium
- |
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
mv selenium.jar $SYLIUS_CACHE_DIR
fi
# Run Selenium
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &

# Run webserver
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web --env=test --quiet > /dev/null 2>&1 &)

script:
- composer validate --strict
- bin/phpstan.phar analyse -c phpstan.neon -l max src/

- bin/phpunit
- bin/phpspec run
- bin/behat --strict -vvv --no-interaction || bin/behat --strict -vvv --no-interaction --rerun
- ls -la tests/Application/var/cache/test
- bin/phpstan.sh
- bin/behat
- bin/ecs.sh

after_failure:
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
<img src="https://avatars0.githubusercontent.com/u/38423357?s=200&v=4"/>
</a>
</p>
<h1 align="center">Extended Channels Plugin</h1>
<h1 align="center">
Extended Channels Plugin
<br />
<a href="https://packagist.org/packages/mangoweb-sylius/sylius-extended-channels" title="License" target="_blank">
<img src="https://img.shields.io/packagist/l/mangoweb-sylius/sylius-extended-channels.svg" />
</a>
<a href="https://packagist.org/packages/mangoweb-sylius/sylius-extended-channels" title="Version" target="_blank">
<img src="https://img.shields.io/packagist/v/mangoweb-sylius/sylius-extended-channels.svg" />
</a>
<a href="http://travis-ci.org/mangoweb-sylius/SyliusExtendedChannelsPlugin" title="Build status" target="_blank">
<img src="https://img.shields.io/travis/mangoweb-sylius/SyliusExtendedChannelsPlugin/master.svg" />
</a>
</h1>

## Features

Expand Down
31 changes: 19 additions & 12 deletions behat.yml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
imports:
- vendor/sylius/sylius/behat.yml.dist
- vendor/sylius/sylius/src/Sylius/Behat/Resources/config/suites.yml
- tests/Behat/Resources/suites.yml

default:
extensions:
FriendsOfBehat\ContextServiceExtension:
imports:
- vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml
- tests/Behat/Resources/services.xml
Lakion\Behat\MinkDebugExtension:
directory: etc/build
clean_start: false
screenshot: true

Behat\MinkExtension:
base_url: "http://localhost:8080/"
default_session: symfony
sessions:
symfony:
symfony: ~

FriendsOfBehat\SymfonyExtension:
bootstrap: tests/Application/config/bootstrap.php
kernel:
class: \App\Kernel
path: tests/Application/src/Kernel.php
bootstrap: vendor/autoload.php
env: test
class: Tests\MangoSylius\ExtendedChannelsPlugin\Application\Kernel

Behat\MinkExtension:
base_url: "http://localhost:8000/"
default_session: symfony
FriendsOfBehat\VariadicExtension: ~

FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"
32 changes: 19 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,40 @@
"require": {
"ext-json": "*",
"php": "^7.1",
"sylius/sylius": "~1.2.3",
"symfony/symfony": "^4.1"
"sylius/sylius": "^1.4"
},
"require-dev": {
"behat/behat": "^3.4",
"behat/mink": "^1.7@dev",
"behat/mink-browserkit-driver": "^1.3",
"behat/mink-extension": "^2.2",
"behat/mink-selenium2-driver": "^1.3",
"friends-of-behat/context-service-extension": "^1.2",
"friends-of-behat/cross-container-extension": "^1.1",
"friends-of-behat/service-container-extension": "^1.0",
"friends-of-behat/symfony-extension": "^1.2.1",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.0",
"friends-of-behat/variadic-extension": "^1.1",
"lakion/mink-debug-extension": "^1.2.3",
"phpspec/phpspec": "^4.0",
"phpspec/phpspec": "^5.0",
"phpstan/phpstan-doctrine": "^0.10",
"phpstan/phpstan-shim": "^0.10",
"phpstan/phpstan-symfony": "^0.10",
"phpstan/phpstan-webmozart-assert": "^0.10",
"phpunit/phpunit": "^6.5",
"sensiolabs/security-checker": "^5.0",
"sylius-labs/coding-standard": "^2.0",
"friends-of-behat/page-object-extension": "^0.2.1"
"symfony/browser-kit": "^3.4|^4.1",
"symfony/debug-bundle": "^3.4|^4.1",
"symfony/dotenv": "^4.2",
"symfony/intl": "^3.4|^4.1",
"symfony/web-profiler-bundle": "^3.4|^4.1",
"symfony/web-server-bundle": "^3.4|^4.1"
},
"conflict": {
"symfony/symfony": "4.1.8"
"symfony/symfony": "4.1.8",
"symfony/browser-kit": "4.1.8",
"symfony/dependency-injection": "4.1.8",
"symfony/dom-crawler": "4.1.8",
"symfony/routing": "4.1.8"
},
"prefer-stable": true,
"autoload": {
Expand All @@ -41,13 +49,11 @@
}
},
"autoload-dev": {
"psr-4": {
"App\\": "tests/Application/src/"
}
"classmap": ["tests/Application/Kernel.php"]
},
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.5-dev"
}
}
}
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ includes:

parameters:
symfony:
container_xml_path: tests/Application/var/cache/test/srcApp_KernelTestDebugContainer.xml
container_xml_path: tests/Application/var/cache/test/testContainer.xml

excludes_analyse:
# Too slow
Expand All @@ -15,4 +15,4 @@ parameters:
- '*/tests/Application/var/*'

- 'src/Service/SwiftMailerAdapter.php'
- 'tests/Behat/Context/Ui/Shop/OrderContext.php'
- 'tests'
27 changes: 13 additions & 14 deletions tests/Application/.babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

{
"presets": [
["env", {
"targets": {
"node": "6"
},
"useBuiltIns": true
}]
],
"plugins": [
["transform-object-rest-spread", {
"useBuiltIns": true
}]
]
"presets": [
["env", {
"targets": {
"node": "6"
},
"useBuiltIns": true
}]
],
"plugins": [
["transform-object-rest-spread", {
"useBuiltIns": true
}]
]
}
15 changes: 7 additions & 8 deletions tests/Application/.env.dist → tests/Application/.env
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=de8fad07a7c13ea682ad37d41b14516d
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
APP_DEBUG=1
APP_SECRET=EDITME
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
MAILER_URL=smtp://localhost
###< symfony/swiftmailer-bundle ###
5 changes: 5 additions & 0 deletions tests/Application/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_SECRET='ch4mb3r0f5ecr3ts'

KERNEL_CLASS='Tests\MangoSylius\ExtendedChannelsPlugin\Application\Kernel'

DATABASE_URL=mysql://db_user:[email protected]:3306/db_name
20 changes: 20 additions & 0 deletions tests/Application/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
extends: 'airbnb-base',
env: {
node: true,
},
rules: {
'object-shorthand': ['error', 'always', {
avoidQuotes: true,
avoidExplicitReturnArrows: true,
}],
'function-paren-newline': ['error', 'consistent'],
'max-len': ['warn', 120, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
},
};
25 changes: 13 additions & 12 deletions tests/Application/.gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/public/assets
/public/css
/public/js
/public/media/*
!/public/media/image/
/public/media/image/*
!/public/media/image/.gitignore

/node_modules

###> symfony/framework-bundle ###
/public/bundles/
/public/assets/
/.env.*.local
/.env.local
/.env.local.php
/public/bundles
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
/phpunit.xml
###< symfony/phpunit-bridge ###

###> symfony/web-server-bundle ###
/.web-server-pid
###< symfony/web-server-bundle ###

.env
/node_modules/

!/public/media/image/.gitkeep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace App\Entity;
namespace Tests\MangoSylius\ExtendedChannelsPlugin\Application\Entity;

use Doctrine\ORM\Mapping as ORM;
use MangoSylius\ExtendedChannelsPlugin\Model\ExtendedChannelInterface;
Expand Down
Loading

0 comments on commit 9ddaf55

Please sign in to comment.