Skip to content

Commit

Permalink
[CI] Moved to Github Actions (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Apr 19, 2022
1 parent 3e1b9e3 commit 1b9dfa2
Show file tree
Hide file tree
Showing 147 changed files with 195 additions and 808 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/browser-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Browser tests

on:
push:
branches:
- master
- "[0-9]+.[0-9]+"
pull_request: ~

jobs:
core-web:
name: "Core Web suite"
uses: ezsystems/ezplatform/.github/workflows/callable-browser-tests.yaml@2.5
with:
test-suite: "--mode=standard --profile=repository-forms --non-strict"
php-image: "ezsystems/php:7.1-v1"
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
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
70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

8 changes: 0 additions & 8 deletions bin/.travis/composer-auth.json

This file was deleted.

12 changes: 0 additions & 12 deletions bin/.travis/prepare_ezplatform.sh

This file was deleted.

19 changes: 0 additions & 19 deletions bin/.travis/prepare_unittest.sh

This file was deleted.

17 changes: 0 additions & 17 deletions bundle/Controller/ContentEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,13 @@ public function __construct(

/**
* Displays and processes a content creation form. Showing the form does not create a draft in the repository.
*
* @param \EzSystems\RepositoryForms\Content\View\ContentCreateView $view
*
* @return \EzSystems\RepositoryForms\Content\View\ContentCreateView
*/
public function createWithoutDraftAction(ContentCreateView $view): ContentCreateView
{
return $view;
}

/**
* @param \EzSystems\RepositoryForms\Content\View\ContentCreateSuccessView $view
*
* @return \EzSystems\RepositoryForms\Content\View\ContentCreateSuccessView
*
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
*/
public function createWithoutDraftSuccessAction(ContentCreateSuccessView $view): ContentCreateSuccessView
Expand All @@ -72,7 +64,6 @@ public function createWithoutDraftSuccessAction(ContentCreateSuccessView $view):
* @param int $fromVersionNo
* @param string $fromLanguage
* @param string $toLanguage
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \EzSystems\RepositoryForms\Content\View\ContentCreateDraftView|\Symfony\Component\HttpFoundation\Response
*
Expand Down Expand Up @@ -125,10 +116,6 @@ public function createContentDraftAction(
}

/**
* @param \EzSystems\RepositoryForms\Content\View\ContentEditView $view
*
* @return \EzSystems\RepositoryForms\Content\View\ContentEditView
*
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
*/
public function editVersionDraftAction(ContentEditView $view): ContentEditView
Expand All @@ -137,10 +124,6 @@ public function editVersionDraftAction(ContentEditView $view): ContentEditView
}

/**
* @param \EzSystems\RepositoryForms\Content\View\ContentEditSuccessView $view
*
* @return \EzSystems\RepositoryForms\Content\View\ContentEditSuccessView
*
* @throws \eZ\Publish\API\Repository\Exceptions\BadStateException
*/
public function editVersionDraftSuccessAction(ContentEditSuccessView $view): ContentEditSuccessView
Expand Down
4 changes: 1 addition & 3 deletions bundle/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use eZ\Publish\API\Repository\UserService;
use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException;
use eZ\Publish\Core\Base\Exceptions\InvalidArgumentType;
use eZ\Publish\Core\Base\Exceptions\UnauthorizedException as CoreUnauthorizedException;
use eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface;
use EzSystems\RepositoryForms\Data\Mapper\UserCreateMapper;
use EzSystems\RepositoryForms\Data\Mapper\UserUpdateMapper;
Expand All @@ -33,7 +34,6 @@
use Symfony\Component\OptionsResolver\Exception\NoSuchOptionException;
use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException;
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
use eZ\Publish\Core\Base\Exceptions\UnauthorizedException as CoreUnauthorizedException;

class UserController extends Controller
{
Expand Down Expand Up @@ -82,7 +82,6 @@ public function __construct(
* @param string $contentTypeIdentifier ContentType id to create
* @param string $language Language code to create the content in (eng-GB, ger-DE, ...))
* @param int $parentLocationId Location the content should be a child of
* @param Request $request
*
* @return UserCreateView|Response
*
Expand Down Expand Up @@ -144,7 +143,6 @@ public function createAction(
* @param int $contentId ContentType id to create
* @param int $versionNo Version number the version should be created from. Defaults to the currently published one.
* @param string $language Language code to create the version in (eng-GB, ger-DE, ...))
* @param Request $request
*
* @return UserUpdateView|Response
*
Expand Down
5 changes: 0 additions & 5 deletions bundle/Controller/UserRegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,12 @@ class UserRegisterController extends Controller
/** @var \EzSystems\EzPlatformUserBundle\Controller\UserRegisterController */
private $userRegisterController;

/**
* @param \EzSystems\EzPlatformUserBundle\Controller\UserRegisterController $userRegisterController
*/
public function __construct(BaseUserRegisterController $userRegisterController)
{
$this->userRegisterController = $userRegisterController;
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \EzSystems\EzPlatformUser\View\Register\FormView|\Symfony\Component\HttpFoundation\Response|null
*
* @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/
namespace EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler;

use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use LogicException;
use Symfony\Component\DependencyInjection\Reference;

/**
Expand All @@ -29,9 +29,7 @@ public function process(ContainerBuilder $container)
foreach ($this->findTaggedFormMapperServices($container) as $id => $tags) {
foreach ($tags as $tag) {
if (!isset($tag['fieldType'])) {
throw new LogicException(
'ez.fieldFormMapper service tags need a "fieldType" attribute to identify which field type the mapper is for. None given.'
);
throw new LogicException('ez.fieldFormMapper service tags need a "fieldType" attribute to identify which field type the mapper is for. None given.');
}

$dispatcherDefinition->addMethodCall('addMapper', [new Reference($id), $tag['fieldType']]);
Expand All @@ -42,8 +40,6 @@ public function process(ContainerBuilder $container)
/**
* Gathers services tagged as either ez.fieldFormMapper.value or ez.fieldFormMapper.definition.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
*
* @return array
*/
private function findTaggedFormMapperServices(ContainerBuilder $container)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/
namespace EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler;

use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use LogicException;
use Symfony\Component\DependencyInjection\Reference;

/**
Expand All @@ -29,9 +29,7 @@ public function process(ContainerBuilder $container)
foreach ($container->findTaggedServiceIds('ez.limitation.formMapper') as $id => $attributes) {
foreach ($attributes as $attribute) {
if (!isset($attribute['limitationType'])) {
throw new LogicException(
'ez.limitation.formMapper service tag needs a "limitationType" attribute to identify which LimitationType the mapper is for. None given.'
);
throw new LogicException('ez.limitation.formMapper service tag needs a "limitationType" attribute to identify which LimitationType the mapper is for. None given.');
}

$registry->addMethodCall('addMapper', [new Reference($id), $attribute['limitationType']]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*/
namespace EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler;

use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use LogicException;

/**
* Compiler pass to register Limitation value mappers.
Expand All @@ -31,10 +31,7 @@ public function process(ContainerBuilder $container)
foreach ($container->findTaggedServiceIds(self::LIMITATION_VALUE_MAPPER_TAG) as $id => $attributes) {
foreach ($attributes as $attribute) {
if (!isset($attribute['limitationType'])) {
throw new LogicException(sprintf(
'%s service tag needs a "limitationType" attribute to identify which LimitationType the mapper is for. None given.',
self::LIMITATION_VALUE_MAPPER_TAG
));
throw new LogicException(sprintf('%s service tag needs a "limitationType" attribute to identify which LimitationType the mapper is for. None given.', self::LIMITATION_VALUE_MAPPER_TAG));
}

$registry->addMethodCall('addMapper', [new Reference($id), $attribute['limitationType']]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
*/
namespace EzSystems\RepositoryFormsBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Yaml\Yaml;

class EzSystemsRepositoryFormsExtension extends Extension implements PrependExtensionInterface
Expand Down
Loading

0 comments on commit 1b9dfa2

Please sign in to comment.