Skip to content

Commit

Permalink
[CI] Moved to GitHub actions (#44)
Browse files Browse the repository at this point in the history
* [CI] Moved to Github Actions

* [CS] Switched to ezsystems/ezplatform-code-style package and config

* [CS] Removed strict types rule

* [CS] Fixed CS
  • Loading branch information
mnocon authored Apr 26, 2022
1 parent 90c5ed2 commit 5b9cec6
Show file tree
Hide file tree
Showing 34 changed files with 163 additions and 209 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches:
- main
- '[0-9]+.[0-9]+'
pull_request: ~

jobs:
cs-fix:
name: Run code style check
runs-on: "ubuntu-20.04"
strategy:
matrix:
php:
- '7.4'
steps:
- uses: actions/checkout@v2

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Unit tests
runs-on: "ubuntu-20.04"
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
php:
- '7.1'
- '7.3'
- '7.4'

steps:
- uses: actions/checkout@v2

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run unit test suite
run: composer test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/vendor/
composer.lock
.php_cs.cache
.php-cs-fixer.cache
18 changes: 18 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
use EzSystems\EzPlatformCodeStyle\PhpCsFixer\EzPlatformInternalConfigFactory;

$configFactory = new EzPlatformInternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false,
]);

return $configFactory->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/lib',
__DIR__ . '/bundle',
__DIR__ . '/tests',
])
->files()->name('*.php')
);
32 changes: 0 additions & 32 deletions .php_cs

This file was deleted.

26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

9 changes: 3 additions & 6 deletions bundle/DataCollector/TwigDataCollector.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DataCollector;

use EzSystems\EzPlatformDesignEngine\Templating\TemplatePathRegistryInterface;
Expand All @@ -18,7 +15,7 @@
class TwigDataCollector extends BaseCollector implements LateDataCollectorInterface
{
/**
* @var TemplatePathRegistryInterface
* @var \EzSystems\EzPlatformDesignEngine\Templating\TemplatePathRegistryInterface
*/
private $templatePathRegistry;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler;

use EzSystems\EzPlatformDesignEngine\Asset\AssetPathProvisionerInterface;
Expand Down
7 changes: 2 additions & 5 deletions bundle/DependencyInjection/Compiler/AssetThemePass.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand Down
7 changes: 2 additions & 5 deletions bundle/DependencyInjection/Compiler/PHPStormPass.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand Down
7 changes: 2 additions & 5 deletions bundle/DependencyInjection/Compiler/TwigThemePass.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler;

use EzSystems\EzPlatformDesignEngineBundle\DataCollector\TwigDataCollector;
Expand Down
7 changes: 2 additions & 5 deletions bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection;

use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Configuration as SiteAccessConfiguration;
Expand Down
7 changes: 2 additions & 5 deletions bundle/DependencyInjection/DesignConfigParser.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection;

use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ParserInterface;
Expand Down
11 changes: 4 additions & 7 deletions bundle/DependencyInjection/EzPlatformDesignEngineExtension.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle\DependencyInjection;

use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class EzPlatformDesignEngineExtension extends Extension
{
Expand Down
7 changes: 2 additions & 5 deletions bundle/EzPlatformDesignEngineBundle.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngineBundle;

use EzSystems\EzPlatformDesignEngineBundle\DependencyInjection\Compiler\AssetPathResolutionPass;
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
},
"require-dev": {
"phpunit/phpunit": "^5.7|^6.0",
"friendsofphp/php-cs-fixer": "~2.7.1",
"ezsystems/ezplatform-code-style": "^1.0",
"friendsofphp/php-cs-fixer": "^2.16.0",
"mikey179/vfsstream": "^1.6.3"
},
"autoload": {
Expand All @@ -36,7 +37,9 @@
}
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
"fix-cs": "php-cs-fixer fix -v --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"test": "phpunit"
},
"extra": {
"branch-alias": {
Expand Down
7 changes: 2 additions & 5 deletions lib/Asset/AssetPathProvisionerInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngine\Asset;

interface AssetPathProvisionerInterface
Expand Down
9 changes: 3 additions & 6 deletions lib/Asset/AssetPathResolver.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngine\Asset;

use EzSystems\EzPlatformDesignEngine\Exception\InvalidDesignException;
Expand All @@ -25,7 +22,7 @@ class AssetPathResolver implements AssetPathResolverInterface
private $webRootDir;

/**
* @var LoggerInterface
* @var \Psr\Log\LoggerInterface
*/
private $logger;

Expand Down
7 changes: 2 additions & 5 deletions lib/Asset/AssetPathResolverInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngine\Asset;

/**
Expand Down
7 changes: 2 additions & 5 deletions lib/Asset/ProvisionedPathResolver.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

/*
* This file is part of the EzPlatformDesignEngine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\EzPlatformDesignEngine\Asset;

use Symfony\Component\Finder\Finder;
Expand Down
Loading

0 comments on commit 5b9cec6

Please sign in to comment.