Skip to content

Commit

Permalink
[e2e] Try add back global e2e tests for scoped (#1786)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Feb 8, 2022
1 parent 6aa48e1 commit f03e2a1
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 0 deletions.
40 changes: 40 additions & 0 deletions build/target-repository/.github/workflows/e2e_global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: End to End global tests

on:
pull_request: null
push:
branches:
- main

jobs:
end_to_end:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php_version: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
directory:
- 'e2e/global-install'

name: End to end test - ${{ matrix.directory }}

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
coverage: none

# wait for deploy to packagist
- run: sleep 70

-
run: |
composer global require --dev rector/rector:dev-main
composer install --ansi
working-directory: ${{ matrix.directory }}

-
run: /home/runner/.composer/vendor/bin/rector process --ansi --clear-cache
working-directory: ${{ matrix.directory }}
1 change: 1 addition & 0 deletions build/target-repository/e2e/global-install/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace App;

interface ExceptionInterface
{
}
8 changes: 8 additions & 0 deletions build/target-repository/e2e/global-install/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autoload": {
"psr-4": {
"App\\": "App",
"GlobalInstall\\": "src"
}
}
}
15 changes: 15 additions & 0 deletions build/target-repository/e2e/global-install/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
use Rector\Core\Configuration\Option;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [__DIR__ . '/src/']);

$services = $containerConfigurator->services();
$services->set(MakeInheritedMethodVisibilitySameAsParentRector::class);
};
13 changes: 13 additions & 0 deletions build/target-repository/e2e/global-install/src/MyException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace GlobalInstall;

use App\ExceptionInterface;

class MyException extends \RuntimeException implements ExceptionInterface
{
public static function forAnything(string $content)
{
return new static($content);
}
}

0 comments on commit f03e2a1

Please sign in to comment.