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

Use ramsey/composer-install action for installing dependencies #542

Merged
Merged
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
39 changes: 13 additions & 26 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
test:
name: "Run tests with php ${{ matrix.php-version }} and elasticsearch ${{ matrix.elasticsearch-version }} (${{ matrix.phpcr-transport }})"
name: "PHP ${{ matrix.php-version }} (elasticsearch ${{ matrix.elasticsearch-version }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})"
runs-on: ubuntu-latest

env:
Expand All @@ -29,7 +29,7 @@ jobs:
elasticsearch-version: '5.6'
elasticsearch-package-constraint: '~5.5'
phpcr-transport: doctrinedbal
composer-flags: '--prefer-lowest --prefer-dist --no-interaction'
dependency-versions: 'lowest'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v1'
php-cs-fixer: false
Expand All @@ -43,7 +43,7 @@ jobs:
elasticsearch-version: '7.9'
elasticsearch-package-constraint: '~7.9.0'
phpcr-transport: jackrabbit
composer-flags: '--prefer-dist --no-interaction'
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
php-cs-fixer: true
Expand Down Expand Up @@ -104,33 +104,20 @@ jobs:
tools: ${{ matrix.tools }}
coverage: none

- name: Get composer cache directory
id: composer-cache-dir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json', 'composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Run php-cs-fixer
if: ${{ matrix.php-cs-fixer }}
run: |
composer global require friendsofphp/php-cs-fixer --prefer-dist --no-interaction
GLOBAL_BIN_DIR=$(composer global config bin-dir --absolute --quiet)
$GLOBAL_BIN_DIR/php-cs-fixer fix --dry-run --diff

- name: Require elasticsearch dependency
run: composer require --dev elasticsearch/elasticsearch:"${{ matrix.elasticsearch-package-constraint }}" --no-interaction --no-update

- name: Install dependencies
- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{matrix.dependency-versions}}

- name: Run php-cs-fixer
if: ${{ matrix.php-cs-fixer }}
run: |
composer validate
composer update ${{ matrix.composer-flags }}
composer global require friendsofphp/php-cs-fixer --prefer-dist --no-interaction
GLOBAL_BIN_DIR=$(composer global config bin-dir --absolute --quiet)
$GLOBAL_BIN_DIR/php-cs-fixer fix --dry-run --diff

- name: Clear parameters.yml file to use environment variables
run: echo "parameters:" > Tests/app/config/parameters.yml
Expand Down
4 changes: 2 additions & 2 deletions Controller/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
*/
class ArticleController extends RestController implements ClassResourceInterface, SecuredControllerInterface
{
const DOCUMENT_TYPE = 'article';

use RequestParametersTrait;
use ArticleViewDocumentIdTrait;

const DOCUMENT_TYPE = 'article';

/**
* Create field-descriptor array.
*
Expand Down
4 changes: 2 additions & 2 deletions Controller/ArticlePageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
*/
class ArticlePageController extends RestController implements ClassResourceInterface, SecuredControllerInterface
{
const DOCUMENT_TYPE = 'article_page';

use RequestParametersTrait;

const DOCUMENT_TYPE = 'article_page';

/**
* Returns single article-page.
*
Expand Down
5 changes: 2 additions & 3 deletions Document/Serializer/ArticleSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
*/
class ArticleSubscriber implements EventSubscriberInterface
{
const PAGE_TITLE_TAG_NAME = 'sulu_article.page_title';
use StructureTagTrait;

const PAGE_TITLE_TAG_NAME = 'sulu_article.page_title';
const PAGE_TITLE_PROPERTY_NAME = 'pageTitle';

use StructureTagTrait;

/**
* @var StructureManagerInterface
*/
Expand Down