Update to latest base module

Cette révision appartient à :
Florian Engelhardt 2021-04-19 13:55:43 +02:00
Parent 6d082f7900
révision d85b851af4
Signature inconnue de Gitea
ID de la clé GPG: 39B8DAD75A95B500
8 fichiers modifiés avec 120 ajouts et 96 suppressions

51
.github/workflows/CI.yml externe Fichier normal
Voir le fichier

@ -0,0 +1,51 @@
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: Ubuntu-20.04
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']
DEPENDENCIES: ['', '--prefer-lowest']
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Create project
run: composer create-project oxid-esales/graphql-module --repository packages.json --remove-vcs -n --no-plugins
- name: Syntax Test
run: composer test:syntax
working-directory: ./graphql-module
- name: Lint Test
run: composer test:lint
working-directory: ./graphql-module
- name: Static Analyzer
run: composer test:static
working-directory: ./graphql-module
- name: Unit Tests
run: composer test:unit
working-directory: ./graphql-module

45
.github/workflows/CI.yml.dist externe Fichier normal
Voir le fichier

@ -0,0 +1,45 @@
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: Ubuntu-20.04
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']
DEPENDENCIES: ['', '--prefer-lowest']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install
run: composer install -n --no-plugins $DEPENDENCIES
- name: Syntax Test
run: composer test:syntax
- name: Lint Test
run: composer test:lint
- name: Static Analyzer
run: composer test:static
- name: Unit Tests
run: composer test:unit

Voir le fichier

@ -3,40 +3,21 @@
declare(strict_types=1);
$header = <<<'EOF'
Copyright © __Vendor__. All rights reserved.
Copyright © __Vender__. All rights reserved.
See LICENSE file for license details.
EOF;
$finder = PhpCsFixer\Finder::create()
->exclude('Codeception/_support/_generated/')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests/');
->in(__DIR__ . '/tests/')
->name('*.stub');
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'blank_line_after_opening_tag' => true,
'compact_nullable_typehint' => true,
'declare_equal_normalize' => [
'space' => 'none'
],
'function_typehint_space' => true,
'final_class' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
],
'new_with_braces' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'return_type_declaration' => [
'space_before' => 'none'
],
'single_trait_insert_per_statement' => true,
'@PSR12' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline'
],
@ -91,6 +72,15 @@ return PhpCsFixer\Config::create()
],
'declare_strict_types' => true,
'dir_constant' => true,
'final_internal_class' => [
'annotation-white-list' => [],
'consider-absent-docblock-as-internal-class' => true,
'annotation-black-list' => [
'@eshopExtension',
'@dataType-extension',
'@extendable-dataType'
],
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,

Voir le fichier

@ -1,29 +0,0 @@
language: php
dist: bionic
notifications:
email: false
php:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
cache:
directories:
- $HOME/.composer/cache/files
matrix:
fast_finish: true
before_script:
- composer create-project oxid-esales/graphql-module --repository packages.json --remove-vcs -n
script:
- cd graphql-module
- composer test:syntax
- composer test:lint
- composer test:static
- composer test:unit

Voir le fichier

@ -1,28 +0,0 @@
language: php
dist: bionic
notifications:
email: false
php:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
cache:
directories:
- $HOME/.composer/cache/files
matrix:
fast_finish: true
before_script:
- composer install --prefer-dist
script:
- composer test:syntax
- composer test:lint
- composer test:static
- composer test:unit

Voir le fichier

@ -11,11 +11,11 @@
},
"require": {
"php": "^7.1",
"oxid-esales/graphql-base": "^3.1.3"
"oxid-esales/graphql-base": "^5.1.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5.20|^8.5|^9",
"friendsofphp/php-cs-fixer": "^2.16.4",
"friendsofphp/php-cs-fixer": "^2.18.2",
"php-parallel-lint/php-parallel-lint": "^1.1",
"phpstan/phpstan": "^0.12.26",
"oxid-esales/oxideshop-ce": "^6.5",
@ -28,12 +28,6 @@
}
},
"scripts": {
"pre-install-cmd": [
"OxidEsales\\GraphQL\\Skeleton\\Installer::preInstall"
],
"pre-update-cmd": [
"OxidEsales\\GraphQL\\Skeleton\\Installer::preInstall"
],
"post-create-project-cmd": [
"OxidEsales\\GraphQL\\Skeleton\\Installer::postInstall",
"composer update",

Voir le fichier

@ -5,7 +5,7 @@
"source": {
"url": "./",
"type": "git",
"reference": "master"
"reference": "master-upgrade-to-latests-base"
}
}
}

Voir le fichier

@ -15,6 +15,10 @@ class Installer
private static $packageName;
public static function preInstall(Event $event): void
{
}
public static function postInstall(Event $event = null): void
{
$io = $event->getIO();
$vendor = self::ask($io, 'What is the vendor?', 'MyVendor');
@ -26,10 +30,9 @@ class Installer
// Update composer definition
$json->write($composerDefinition);
$io->write("<info>composer.json for {$composerDefinition['name']} is created.\n</info>");
}
public static function postInstall(Event $event = null): void
{
unset($event);
list($vendor, $package, $packageFull) = self::$packageName;
$skeletonRoot = dirname(__DIR__);
@ -37,10 +40,9 @@ class Installer
// remove installer files
unlink($skeletonRoot.'/README.md');
unlink($skeletonRoot.'/LICENSE');
unlink($skeletonRoot.'/.travis.yml');
unlink($skeletonRoot.'/packages.json');
rename($skeletonRoot.'/README.md.dist', $skeletonRoot.'/README.md');
rename($skeletonRoot.'/.travis.yml.dist', $skeletonRoot.'/.travis.yml');
rename($skeletonRoot.'/.github/workflows/CI.yml.dist', $skeletonRoot.'/.github/workflows/CI.yml');
unlink(__FILE__);
}
@ -74,8 +76,7 @@ class Installer
unset(
$composerDefinition['autoload']['files'],
$composerDefinition['scripts']['pre-install-cmd'],
$composerDefinition['scripts']['pre-update-cmd'],
$composerDefinition['scripts']['post-create-project-cmd'],
$composerDefinition['scripts']['post-install-cmd'],
$composerDefinition['homepage']
);