From 1f70da12681f2f1e7e5040df7c3f4b0a8e881667 Mon Sep 17 00:00:00 2001 From: Jan Stockfisch Date: Mon, 6 Jun 2022 21:11:10 +0200 Subject: [PATCH 1/3] [#18] Add ecs dependency --- composer.json | 3 ++- ecs.php | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 ecs.php diff --git a/composer.json b/composer.json index 75bb701..271549e 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,8 @@ "satooshi/php-coveralls": "^2.0", "michielroos/typo3scan": "^1.7", "squizlabs/php_codesniffer": "^3.6", - "nimut/testing-framework": "^6" + "nimut/testing-framework": "^6", + "symplify/easy-coding-standard": "^10.2" }, "autoload": { "psr-4": { diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..43db093 --- /dev/null +++ b/ecs.php @@ -0,0 +1,19 @@ +paths([ + __DIR__ . '/Classes', + __DIR__ . '/Configuration', + __DIR__ . '/Tests', + __DIR__ . '/ecs.php' + ]); + + $ecsConfig->sets([ + SetList::PSR_12, + SetList::CLEAN_CODE, + SetList::COMMON + ]); +}; From e7b3b2fd7227d37f109c62fcb482ee33e89cc25c Mon Sep 17 00:00:00 2001 From: Jan Stockfisch Date: Mon, 6 Jun 2022 21:30:45 +0200 Subject: [PATCH 2/3] [#18] Run ecs with basic config and basic sets --- .../Configuration/ExtensionConfiguration.php | 23 ++-- Classes/Enumeration/GitCommandEnumeration.php | 9 +- .../ProjectVersionModeEnumeration.php | 6 +- Classes/Facade/CommandUtilityFacade.php | 3 - Classes/Service/ProjectVersion.php | 26 +--- Classes/Service/ProjectVersionService.php | 11 +- .../ProjectVersionEventListenerTest.php | 13 +- .../Service/ProjectVersionServiceTest.php | 114 +++++++----------- Tests/Unit/Service/ProjectVersionTest.php | 33 +---- ecs.php | 10 +- 10 files changed, 86 insertions(+), 162 deletions(-) diff --git a/Classes/Configuration/ExtensionConfiguration.php b/Classes/Configuration/ExtensionConfiguration.php index cb3cccb..b8a2825 100644 --- a/Classes/Configuration/ExtensionConfiguration.php +++ b/Classes/Configuration/ExtensionConfiguration.php @@ -21,9 +21,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; -/** - * Class ExtensionConfiguration - */ final class ExtensionConfiguration implements SingletonInterface { private const DEFAULT_VERSION_FILE = 'VERSION'; @@ -60,10 +57,17 @@ final class ExtensionConfiguration implements SingletonInterface */ private $staticVersion; + public function __construct() + { + $this->configuration = $this->getExtensionConfigurationFromGlobals(); + $this->versionFilePath = $this->resolveVersionFilePath(); + $this->mode = $this->configuration['mode'] ?? ProjectVersionModeEnumeration::FILE; + $this->gitFormat = $this->configuration['gitFormat'] ?? ''; + $this->staticVersion = $this->configuration['staticVersion'] ?? ''; + } + /** * Fetch absolute version filename. - * - * @return string */ public function getAbsVersionFilePath(): string { @@ -90,15 +94,6 @@ public function getStaticVersion(): string return $this->staticVersion; } - public function __construct() - { - $this->configuration = $this->getExtensionConfigurationFromGlobals(); - $this->versionFilePath = $this->resolveVersionFilePath(); - $this->mode = $this->configuration['mode'] ?? ProjectVersionModeEnumeration::FILE; - $this->gitFormat = $this->configuration['gitFormat'] ?? ''; - $this->staticVersion = $this->configuration['staticVersion'] ?? ''; - } - private function getExtensionConfigurationFromGlobals(): array { return $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['project_version'] ?? []; diff --git a/Classes/Enumeration/GitCommandEnumeration.php b/Classes/Enumeration/GitCommandEnumeration.php index ebe101a..56219d5 100644 --- a/Classes/Enumeration/GitCommandEnumeration.php +++ b/Classes/Enumeration/GitCommandEnumeration.php @@ -16,18 +16,21 @@ namespace KamiYang\ProjectVersion\Enumeration; -/** - * Class GitCommandEnumeration - */ final class GitCommandEnumeration { public const CMD_BRANCH = 'git rev-parse --abbrev-ref HEAD'; + public const CMD_REVISION = 'git rev-parse --short HEAD'; + public const CMD_TAG = 'git describe --tags'; public const FORMAT_REVISION = '0'; + public const FORMAT_REVISION_BRANCH = '1'; + public const FORMAT_REVISION_TAG = '2'; + public const FORMAT_BRANCH = '3'; + public const FORMAT_TAG = '4'; } diff --git a/Classes/Enumeration/ProjectVersionModeEnumeration.php b/Classes/Enumeration/ProjectVersionModeEnumeration.php index 44f121e..ae6a786 100644 --- a/Classes/Enumeration/ProjectVersionModeEnumeration.php +++ b/Classes/Enumeration/ProjectVersionModeEnumeration.php @@ -16,13 +16,13 @@ namespace KamiYang\ProjectVersion\Enumeration; -/** - * Class ProjectVersionModeEnumeration - */ final class ProjectVersionModeEnumeration { public const FILE = '0'; + public const GIT = '1'; + public const GIT_FILE_FALLBACK = '2'; + public const STATIC_VERSION = '3'; } diff --git a/Classes/Facade/CommandUtilityFacade.php b/Classes/Facade/CommandUtilityFacade.php index af172f4..6df2aaf 100644 --- a/Classes/Facade/CommandUtilityFacade.php +++ b/Classes/Facade/CommandUtilityFacade.php @@ -18,9 +18,6 @@ use TYPO3\CMS\Core\Utility\CommandUtility; -/** - * Class CommandUtilityFacade - */ class CommandUtilityFacade { /** diff --git a/Classes/Service/ProjectVersion.php b/Classes/Service/ProjectVersion.php index 08527b1..339423d 100644 --- a/Classes/Service/ProjectVersion.php +++ b/Classes/Service/ProjectVersion.php @@ -20,21 +20,19 @@ use function trim; -/** - * Class ProjectVersion - */ class ProjectVersion implements SingletonInterface { public const UNKNOWN_VERSION = self::LLL . ':toolbarItems.sysinfo.project-version.unknown'; + private const LLL = 'LLL:EXT:project_version/Resources/Private/Language/Backend.xlf'; /** - * @var string $title + * @var string */ protected $title = self::LLL . ':toolbarItems.sysinfo.project-version'; /** - * @var string $version + * @var string */ protected $version = self::UNKNOWN_VERSION; @@ -43,49 +41,31 @@ class ProjectVersion implements SingletonInterface */ protected $iconIdentifier = 'information-project-version'; - /** - * @return string - */ public function getTitle(): string { return $this->title; } - /** - * @param string $title - */ public function setTitle(string $title): void { $this->title = $title; } - /** - * @return string - */ public function getVersion(): string { return $this->version; } - /** - * @param string $version - */ public function setVersion(string $version): void { $this->version = trim($version); } - /** - * @return string - */ public function getIconIdentifier(): string { return $this->iconIdentifier; } - /** - * @param string $iconIdentifier - */ public function setIconIdentifier(string $iconIdentifier): void { $this->iconIdentifier = $iconIdentifier; diff --git a/Classes/Service/ProjectVersionService.php b/Classes/Service/ProjectVersionService.php index 5ee973d..3404783 100644 --- a/Classes/Service/ProjectVersionService.php +++ b/Classes/Service/ProjectVersionService.php @@ -30,15 +30,13 @@ use function sprintf; use function trim; -/** - * Class ProjectVersionService - */ class ProjectVersionService implements SingletonInterface { /** * @var CommandUtilityFacade */ protected $commandUtilityFacade; + /** * @var ExtensionConfiguration */ @@ -80,7 +78,6 @@ public function getProjectVersion(): ProjectVersion /** * @internal protected so we can mock it in unit tests. - * @return bool */ protected function isGitAvailable(): bool { @@ -129,12 +126,12 @@ private function setVersionFromFile(ProjectVersion $projectVersion): void private function setVersionFromGit(ProjectVersion $projectVersion): void { - if (!$this->isGitAvailable()) { + if (! $this->isGitAvailable()) { return; } $version = $this->getVersionByFormat(); - if (!empty($version)) { + if (! empty($version)) { $gitIconIdentifier = 'information-git'; $projectVersion->setVersion($version); @@ -158,6 +155,6 @@ private function getVersionByFormat(): string private function isExecEnabled(): bool { - return !in_array('exec', GeneralUtility::trimExplode(',', ini_get('disable_functions')), true); + return ! in_array('exec', GeneralUtility::trimExplode(',', ini_get('disable_functions')), true); } } diff --git a/Tests/Unit/EventListener/ProjectVersionEventListenerTest.php b/Tests/Unit/EventListener/ProjectVersionEventListenerTest.php index 1d2c69c..3ba7474 100644 --- a/Tests/Unit/EventListener/ProjectVersionEventListenerTest.php +++ b/Tests/Unit/EventListener/ProjectVersionEventListenerTest.php @@ -25,9 +25,6 @@ use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * Class ProjectVersionSlotTest - */ class ProjectVersionEventListenerTest extends UnitTestCase { /** @@ -47,10 +44,7 @@ protected function tearDown(): void parent::tearDown(); } - /** - * @test - */ - public function getProjectVersionShouldAddProjectVersionAsSystemInformation(): void + public function testGetProjectVersionShouldAddProjectVersionAsSystemInformation(): void { $version = '9000-rc.69'; $title = 'Project Version'; @@ -69,10 +63,7 @@ public function getProjectVersionShouldAddProjectVersionAsSystemInformation(): v ->shouldHaveBeenCalledTimes(1); } - /** - * @test - */ - public function getProjectVersionShouldResolveCurrentVersionAndLocalizeItIfNecessary(): void + public function testGetProjectVersionShouldResolveCurrentVersionAndLocalizeItIfNecessary(): void { $initialVersionValue = 'LLL:EXT:project_version/Resources/Private/Language/Backend.xlf:toolbarItems.sysinfo.project-version.unknown'; $projectVersion = new ProjectVersion(); diff --git a/Tests/Unit/Service/ProjectVersionServiceTest.php b/Tests/Unit/Service/ProjectVersionServiceTest.php index a91cd02..434bf60 100644 --- a/Tests/Unit/Service/ProjectVersionServiceTest.php +++ b/Tests/Unit/Service/ProjectVersionServiceTest.php @@ -31,9 +31,6 @@ use function ini_get; use function ini_set; -/** - * Class ProjectVersionServiceTest - */ class ProjectVersionServiceTest extends UnitTestCase { /** @@ -45,7 +42,7 @@ class ProjectVersionServiceTest extends UnitTestCase 'gitFormat' => GitCommandEnumeration::FORMAT_REVISION_BRANCH, 'mode' => ProjectVersionModeEnumeration::FILE, 'staticVersion' => '', - 'versionFilePath' => 'VERSION' + 'versionFilePath' => 'VERSION', ]; /** @@ -53,13 +50,22 @@ class ProjectVersionServiceTest extends UnitTestCase */ private $commandUtilityFacadeProphecy; - /** - * @test - */ - public function getProjectVersionShouldNotSetProjectVersionIfVersionFileIsNotFound(): void + protected function setUp(): void + { + $this->commandUtilityFacadeProphecy = $this->prophesize(CommandUtilityFacade::class); + } + + protected function tearDown(): void + { + GeneralUtility::purgeInstances(); + + parent::tearDown(); + } + + public function testGetProjectVersionShouldNotSetProjectVersionIfVersionFileIsNotFound(): void { $this->setUpExtensionConfiguration([ - 'versionFilePath' => '/some/not/existing/path' + 'versionFilePath' => '/some/not/existing/path', ]); $projectVersionProphecy = $this->prophesize(ProjectVersion::class); @@ -71,13 +77,13 @@ public function getProjectVersionShouldNotSetProjectVersionIfVersionFileIsNotFou } /** - * @test - * @param string $versionFilePath * @dataProvider versionFilePathDataProvider */ - public function getProjectVersionShouldSetVersionFromVersionFileIfFileExists(string $versionFilePath): void + public function testGetProjectVersionShouldSetVersionFromVersionFileIfFileExists(string $versionFilePath): void { - $this->setUpExtensionConfiguration(['versionFilePath' => $versionFilePath]); + $this->setUpExtensionConfiguration([ + 'versionFilePath' => $versionFilePath, + ]); $subject = $this->getSubject(); @@ -90,22 +96,21 @@ public function getProjectVersionShouldSetVersionFromVersionFileIfFileExists(str public function versionFilePathDataProvider(): Generator { yield 'version file with EXT shortcut' => [ - 'EXT:project_version/Tests/Fixture/VERSION' + 'EXT:project_version/Tests/Fixture/VERSION', ]; yield 'directory with EXT shortcut' => [ - 'EXT:project_version/Tests/Fixture/' + 'EXT:project_version/Tests/Fixture/', ]; yield 'Version file with EXT shortcut and different filename' => [ - 'EXT:project_version/Tests/Fixture/VersionFileWithDifferentName' + 'EXT:project_version/Tests/Fixture/VersionFileWithDifferentName', ]; } - /** - * @test - */ - public function getProjectVersionShouldNotSetVersionFromGitIfCommandExecIsNotAvailable(): void + public function testGetProjectVersionShouldNotSetVersionFromGitIfCommandExecIsNotAvailable(): void { - $this->setUpExtensionConfiguration(['mode' => ProjectVersionModeEnumeration::GIT]); + $this->setUpExtensionConfiguration([ + 'mode' => ProjectVersionModeEnumeration::GIT, + ]); $projectVersionProphecy = $this->prophesize(ProjectVersion::class); GeneralUtility::setSingletonInstance(ProjectVersion::class, $projectVersionProphecy->reveal()); @@ -122,17 +127,9 @@ public function getProjectVersionShouldNotSetVersionFromGitIfCommandExecIsNotAva } /** - * @test - * - * @param string $format - * @param string $branch - * @param string $revision - * @param string $tag - * @param string $expected - * * @dataProvider gitFormatDataProvider */ - public function getProjectVersionShouldReturnSpecifiedVersionBasedOnConfiguredGitFormat( + public function testGetProjectVersionShouldReturnSpecifiedVersionBasedOnConfiguredGitFormat( string $format, string $branch, string $revision, @@ -141,7 +138,7 @@ public function getProjectVersionShouldReturnSpecifiedVersionBasedOnConfiguredGi ): void { $this->setUpExtensionConfiguration([ 'mode' => ProjectVersionModeEnumeration::GIT, - 'gitFormat' => $format + 'gitFormat' => $format, ]); $returnValue = 0; $this->commandUtilityFacadeProphecy->exec('git --version', $_, $returnValue) @@ -170,16 +167,13 @@ public function getProjectVersionShouldReturnSpecifiedVersionBasedOnConfiguredGi $this->commandUtilityFacadeProphecy->exec(GitCommandEnumeration::CMD_TAG)->shouldHaveBeenCalledTimes(1); } - /** - * @test - */ - public function getProjectVersionShouldTryToFetchVersionFromFileIfResolvingUsingGitErrored(): void + public function testGetProjectVersionShouldTryToFetchVersionFromFileIfResolvingUsingGitErrored(): void { $versionFilePath = 'EXT:project_version/Tests/Fixture/VERSION'; $this->setUpExtensionConfiguration([ 'versionFilePath' => $versionFilePath, 'mode' => ProjectVersionModeEnumeration::GIT_FILE_FALLBACK, - 'gitFormat' => GitCommandEnumeration::FORMAT_REVISION_BRANCH + 'gitFormat' => GitCommandEnumeration::FORMAT_REVISION_BRANCH, ]); $branch = ''; $revision = ''; @@ -197,9 +191,6 @@ public function getProjectVersionShouldTryToFetchVersionFromFileIfResolvingUsing static::assertSame($expected, $subject->getProjectVersion()->getVersion()); } - /** - * @return Generator - */ public function gitFormatDataProvider(): Generator { $branch = 'master'; @@ -211,51 +202,50 @@ public function gitFormatDataProvider(): Generator 'branch' => $branch, 'revision' => $revision, 'tag' => $tag, - 'expected' => "[{$revision}] {$branch}" + 'expected' => "[{$revision}] {$branch}", ]; yield 'git format: revision' => [ 'format' => GitCommandEnumeration::FORMAT_REVISION, 'branch' => $branch, 'revision' => $revision, 'tag' => $tag, - 'expected' => "{$revision}" + 'expected' => "{$revision}", ]; yield 'git format: [revision] branch' => [ 'format' => GitCommandEnumeration::FORMAT_REVISION_BRANCH, 'branch' => $branch, 'revision' => $revision, 'tag' => $tag, - 'expected' => "[{$revision}] {$branch}" + 'expected' => "[{$revision}] {$branch}", ]; yield 'git format: [revision] tag' => [ 'format' => GitCommandEnumeration::FORMAT_REVISION_TAG, 'branch' => $branch, 'revision' => $revision, 'tag' => $tag, - 'expected' => "[{$revision}] {$tag}" + 'expected' => "[{$revision}] {$tag}", ]; yield 'git format: branch' => [ 'format' => GitCommandEnumeration::FORMAT_BRANCH, 'branch' => $branch, 'revision' => $revision, 'tag' => $tag, - 'expected' => "{$branch}" + 'expected' => "{$branch}", ]; yield 'git format: tag' => [ 'format' => GitCommandEnumeration::FORMAT_TAG, 'branch' => $branch, 'revision' => $revision, 'tag' => $tag, - 'expected' => "{$tag}" + 'expected' => "{$tag}", ]; } - /** - * @test - */ - public function getProjectVersionShouldAlwaysSetStaticVersionIfSelected(): void + public function testGetProjectVersionShouldAlwaysSetStaticVersionIfSelected(): void { - $this->setUpExtensionConfiguration(['mode' => ProjectVersionModeEnumeration::STATIC_VERSION]); + $this->setUpExtensionConfiguration([ + 'mode' => ProjectVersionModeEnumeration::STATIC_VERSION, + ]); $subject = $this->getSubject(); @@ -266,16 +256,14 @@ public function getProjectVersionShouldAlwaysSetStaticVersionIfSelected(): void } /** - * @test - * @param string $staticVersion * @dataProvider staticVersionDataProvider */ - public function getProjectVersionShouldSetStaticVersionFromExtensionConfigurationIfSelected( + public function testGetProjectVersionShouldSetStaticVersionFromExtensionConfigurationIfSelected( string $staticVersion ): void { $this->setUpExtensionConfiguration([ 'mode' => ProjectVersionModeEnumeration::STATIC_VERSION, - 'staticVersion' => $staticVersion + 'staticVersion' => $staticVersion, ]); $subject = $this->getSubject(); @@ -289,28 +277,16 @@ public function getProjectVersionShouldSetStaticVersionFromExtensionConfiguratio public function staticVersionDataProvider(): Generator { yield 'empty static version (default value)' => [ - 'staticVersion' => '' + 'staticVersion' => '', ]; yield 'some value' => [ - 'staticVersion' => 'some value' + 'staticVersion' => 'some value', ]; yield 'some extreme long value' => [ - 'staticVersion' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos hic ipsa labore molestiae nesciunt quo repellendus similique tenetur vitae voluptatem! Dicta dolor minus nostrum ratione voluptas? Ad animi iste sunt!' + 'staticVersion' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos hic ipsa labore molestiae nesciunt quo repellendus similique tenetur vitae voluptatem! Dicta dolor minus nostrum ratione voluptas? Ad animi iste sunt!', ]; } - protected function setUp(): void - { - $this->commandUtilityFacadeProphecy = $this->prophesize(CommandUtilityFacade::class); - } - - protected function tearDown(): void - { - GeneralUtility::purgeInstances(); - - parent::tearDown(); - } - protected function setUpExtensionConfiguration(array $extConfig): void { $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['project_version'] = array_replace( diff --git a/Tests/Unit/Service/ProjectVersionTest.php b/Tests/Unit/Service/ProjectVersionTest.php index 1e96e41..7f3bdd9 100644 --- a/Tests/Unit/Service/ProjectVersionTest.php +++ b/Tests/Unit/Service/ProjectVersionTest.php @@ -19,9 +19,6 @@ use KamiYang\ProjectVersion\Service\ProjectVersion; use Nimut\TestingFramework\TestCase\UnitTestCase; -/** - * Class ProjectVersionTest - */ class ProjectVersionTest extends UnitTestCase { /** @@ -34,10 +31,7 @@ protected function setUp(): void $this->subject = new ProjectVersion(); } - /** - * @test - */ - public function getTitleShouldReturnInitialValue(): void + public function testGetTitleShouldReturnInitialValue(): void { static::assertSame( 'LLL:EXT:project_version/Resources/Private/Language/Backend.xlf:toolbarItems.sysinfo.project-version', @@ -45,10 +39,7 @@ public function getTitleShouldReturnInitialValue(): void ); } - /** - * @test - */ - public function setTitleShouldSetPropertyTitle(): void + public function testSetTitleShouldSetPropertyTitle(): void { $newValue = 'Project Version is awesome!'; @@ -60,10 +51,7 @@ public function setTitleShouldSetPropertyTitle(): void ); } - /** - * @test - */ - public function initialVersionValueShouldBeLLLString(): void + public function testInitialVersionValueShouldBeLLLString(): void { static::assertSame( 'LLL:EXT:project_version/Resources/Private/Language/Backend.xlf:toolbarItems.sysinfo.project-version.unknown', @@ -71,10 +59,7 @@ public function initialVersionValueShouldBeLLLString(): void ); } - /** - * @test - */ - public function setVersionShouldSetPropertyVersion(): void + public function testSetVersionShouldSetPropertyVersion(): void { $newValue = 'Project Version is awesome!'; @@ -86,18 +71,12 @@ public function setVersionShouldSetPropertyVersion(): void ); } - /** - * @test - */ - public function getIconIdentifierShouldReturnInitialValue(): void + public function testGetIconIdentifierShouldReturnInitialValue(): void { static::assertSame('information-project-version', $this->subject->getIconIdentifier()); } - /** - * @test - */ - public function setIconIdentifierShouldSetPropertyIconIdentifier(): void + public function testSetIconIdentifierShouldSetPropertyIconIdentifier(): void { $newValue = 'Project Version is awesome!'; diff --git a/ecs.php b/ecs.php index 43db093..9f245e8 100644 --- a/ecs.php +++ b/ecs.php @@ -1,5 +1,7 @@ sets([ SetList::PSR_12, SetList::CLEAN_CODE, - SetList::COMMON + SetList::COMMON, + ]); + + $ecsConfig->skip([ + \PhpCsFixer\Fixer\Import\OrderedImportsFixer::class, // this guy mixes everything into a single mess. so we need to do this manually ]); }; From 0c6072080729db9d6e4b74a1de620fa14128271c Mon Sep 17 00:00:00 2001 From: Jan Stockfisch Date: Mon, 6 Jun 2022 21:42:01 +0200 Subject: [PATCH 3/3] [#18] Run ecs using GHA --- .github/workflows/ci.yml | 1 - .github/workflows/cs.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56841f5..447321b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: [ "master" ] pull_request: - branches: [ "master" ] jobs: ci: diff --git a/.github/workflows/cs.yml b/.github/workflows/cs.yml new file mode 100644 index 0000000..e51f4d8 --- /dev/null +++ b/.github/workflows/cs.yml @@ -0,0 +1,31 @@ +name: Coding Style + +on: + push: + branches: [ "master" ] + pull_request: ~ + +jobs: + ci: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v3 + - name: Set up PHP Version + uses: shivammathur/setup-php@v2 + with: + php-version: 7.2 + tools: composer:v1 + - name: Validate composer.json + run: composer validate --strict + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: .Build/vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-php-latest + - name: Install dependencies + run: composer install + - name: ECS + run: .Build/bin/ecs