Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jan 7, 2022
2 parents 111cc8e + 5915371 commit 3343552
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests export-ignore
docs export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
bin/console export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
phpstan-console-application.php export-ignore
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/symfony-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# DO NOT EDIT THIS FILE!
#
# It's auto-generated by sonata-project/dev-kit package.

name: Symfony Lint

on:
schedule:
- cron: '30 0 * * *'
push:
branches:
- 3.x
- 4.x
- 5.x
pull_request:

jobs:
container:
name: Symfony container

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer:v2

- name: Install Composer dependencies (highest)
uses: ramsey/composer-install@v1
with:
dependency-versions: highest
composer-options: --prefer-dist --prefer-stable

- name: Lint container
run: make lint-symfony-container

twig:
name: Twig files

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer:v2

- name: Install Composer dependencies (highest)
uses: ramsey/composer-install@v1
with:
dependency-versions: highest
composer-options: --prefer-dist --prefer-stable

- name: Lint twig files
run: make lint-symfony-twig

xliff:
name: XLIFF files

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer:v2

- name: Install Composer dependencies (highest)
uses: ramsey/composer-install@v1
with:
dependency-versions: highest
composer-options: --prefer-dist --prefer-stable

- name: Lint xliff files
run: make lint-symfony-xliff

yaml:
name: YML files

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
tools: composer:v2

- name: Install Composer dependencies (highest)
uses: ramsey/composer-install@v1
with:
dependency-versions: highest
composer-options: --prefer-dist --prefer-stable

- name: Lint yaml files
run: make lint-symfony-yaml
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ lint-php:
php-cs-fixer fix --ansi --verbose --diff --dry-run
.PHONY: lint-php

lint-symfony: lint-symfony-container lint-symfony-twig lint-symfony-xliff lint-symfony-yaml
.PHONY: lint-symfony

lint-symfony-container:
bin/console lint:container
.PHONY: lint-symfony-container

lint-symfony-twig:
bin/console lint:twig src tests
.PHONY: lint-symfony-twig

lint-symfony-xliff:
bin/console lint:xliff src tests
.PHONY: lint-symfony-xliff

lint-symfony-yaml:
bin/console lint:yaml src tests
.PHONY: lint-symfony-yaml

cs-fix: cs-fix-php cs-fix-xml cs-fix-xliff cs-fix-composer
.PHONY: cs-fix

Expand Down
29 changes: 29 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Sonata\MediaBundle\Tests\App\AppKernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the ' . PHP_SAPI . ' SAPI' . PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new AppKernel();
$application = new Application($kernel);
$application->run(new ArgvInput());
2 changes: 1 addition & 1 deletion src/Resources/translations/SonataMediaBundle.pt_BR.xliff
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="pt" datatype="plaintext" original="file.ext">
<file source-language="en" target-language="pt-BR" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="default">
<source>default</source>
Expand Down

0 comments on commit 3343552

Please sign in to comment.