build(dev-deps): update rector/rector requirement from 0.12.* || ^0.9… #344
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Review | |
on: [push, pull_request] | |
jobs: | |
pre-checks: | |
name: Pre-checks | |
runs-on: ubuntu-20.04 | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- name: Checking for duplicated actions | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@v3 | |
with: | |
concurrent_skipping: 'same_content_newer' | |
general: | |
name: General | |
runs-on: ubuntu-20.04 | |
needs: pre-checks | |
if: ${{ needs.pre-checks.outputs.should_skip != 'true' }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: '12' | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
run: | | |
echo "::set-output name=dir::$(npm config get cache)" | |
- name: NPM (cache) | |
uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Node.js dependencies | |
run: npm install | |
- name: Linting general code | |
run: npm run cs:lint | |
pre-checks-php: | |
name: Changes in PHP | |
runs-on: ubuntu-20.04 | |
needs: pre-checks | |
if: ${{ needs.pre-checks.outputs.should_skip != 'true' }} | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- name: Checking for duplicated actions targeting PHP | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@v3 | |
with: | |
paths: | | |
[ | |
".github/workflows/code-review.yml", | |
".scrutinizer.yml", | |
"**/*.php", | |
"composer.json", | |
"phpcs.xml", | |
"phpstan.neon", | |
"phpunit.xml" | |
] | |
php: | |
name: PHP | |
runs-on: ubuntu-20.04 | |
needs: pre-checks-php | |
if: ${{ needs.pre-checks-php.outputs.should_skip != 'true' }} | |
strategy: | |
max-parallel: 2 | |
matrix: | |
php: ['8.0', '7.4', '7.3'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP ${{ matrix.php }} environment | |
uses: nanasess/[email protected] | |
with: | |
php-version: ${{ matrix.php }} | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Composer (cache) | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Linting PHP syntax | |
run: composer cs:php | |
- name: Linting PHP Coding Standard | |
run: composer cs:lint | |
- name: Linting PHP Refactor improvements | |
run: composer refactor:lint | |
- name: Running tests | |
run: composer test |