Skip to content

Commit

Permalink
Merge 2993dd3 into 9d82dd0
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 11, 2020
2 parents 9d82dd0 + 2993dd3 commit f27f2ed
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 62 deletions.
102 changes: 53 additions & 49 deletions .github/workflows/code_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,80 +1,84 @@
# inspired at https://github.com/Symplify/Symplify/blob/master/.github/workflows/code_checks.yaml
name: Code_Checks

on:
- pull_request
pull_request: null
push:
branches:
- master

jobs:
ecs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.2', '7.3', '7.4']

name: PHP ${{ matrix.php }} tests
steps:
-
name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2
# # required for "git tag" presence for MonorepoBuilder split and ChangelogLinker git tags resolver; default is 1
# - run: git fetch --depth=100000 origin

-
name: Setup PHP
uses: shivammathur/setup-php@v1
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
php-version: ${{ matrix.php }}
coverage: none

-
name: Install
run:
composer install --no-progress
- run: composer install --no-progress
- run: vendor/bin/phpunit --verbose

-
name: Run
run:
composer check-cs
test_lowest_dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# - run: git fetch --depth=100000 origin

phpstan:
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.2
coverage: none

- run: composer update --no-progress --prefer-lowest
- run: vendor/bin/phpunit

ecs:
runs-on: ubuntu-latest

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

-
name: Setup PHP
uses: shivammathur/setup-php@v1
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

-
name: Install
run:
composer install --no-progress
- run: composer install --no-progress
- run: composer check-cs

-
name: Run
run:
composer phpstan
phpstan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

- run: composer install --no-progress
- run: composer phpstan

rector:
runs-on: ubuntu-latest

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

-
name: Setup PHP
uses: shivammathur/setup-php@v1
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none

-
name: Install
run:
composer install --no-progress

-
name: Run
run:
composer rector
- run: composer install --no-progress
- run: composer rector
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ php:
- 7.4

before_script:
- git --version
# disable xdebug if not coverage
- phpenv config-rm xdebug.ini

script:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"phpstan/phpstan": "^0.12.4",
"symplify/changelog-linker": "^7.2",
"symplify/phpstan-extensions": "^7.2",
"rector/rector": "^0.6.7",
"rector/rector": "^0.6.9",
"tracy/tracy": "^2.7",
"phpstan/phpstan-phpunit": "^0.12"
},
Expand All @@ -43,6 +43,6 @@
"fix-cs": "vendor/bin/ecs check src tests --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse src tests --error-format symplify --ansi",
"changelog": "vendor/bin/changelog-linker dump-merges --in-categories --ansi",
"rector": "vendor/bin/rector process src tests --config rector-ci.yaml"
"rector": "vendor/bin/rector process src tests --config rector-ci.yaml --ansi"
}
}
19 changes: 10 additions & 9 deletions tests/GitWorkingCopyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ protected function tearDown(): void

$this->filesystem->remove(self::REPO_DIR);

if (is_dir('build/tests/wc_init')) {
$this->filesystem->remove('build/tests/wc_init');
}

if (is_dir(self::WORKING_DIR)) {
$this->filesystem->remove(self::WORKING_DIR);
}
$dirsToRemove = [
'build/tests/wc_init',
self::WORKING_DIR,
self::REMOTE_REPO_DIR,
];

if (is_dir(self::REMOTE_REPO_DIR)) {
$this->filesystem->remove(self::REMOTE_REPO_DIR);
foreach ($dirsToRemove as $dirToRemove) {
if (is_dir($dirToRemove)) {
$this->filesystem->remove($dirToRemove);
}
}
}

Expand All @@ -110,6 +110,7 @@ protected function tearDown(): void
public function getWorkingCopy(string $directory = self::WORKING_DIR): GitWorkingCopy
{
$git = $this->gitWrapper->workingCopy($directory);

$git->cloneRepository('file://' . realpath(self::REPO_DIR));
$git->config('user.email', self::CONFIG_EMAIL);
$git->config('user.name', self::CONFIG_NAME);
Expand Down

0 comments on commit f27f2ed

Please sign in to comment.