Handle copy error in setup #23
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: Check | |
on: | |
push: | |
branches: [main, bugfix, temp] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
env: | |
writable: ${{ github.event_name != 'push' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && 1 || 0 }} | |
jobs: | |
rexlint: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
coverage: none # disable xdebug, pcov | |
- name: Composer install | |
uses: ramsey/composer-install@v2 | |
- name: Run rexlint | |
run: vendor/bin/rexlint | |
php-cs-fixer: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
if: env.writable == 1 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.BOT_TOKEN }} | |
- name: Checkout fork | |
uses: actions/checkout@v3 | |
if: env.writable == 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
coverage: none # disable xdebug, pcov | |
tools: cs2pr | |
- name: Composer install | |
uses: ramsey/composer-install@v2 | |
- name: Fix code style | |
if: env.writable == 1 | |
run: vendor/bin/php-cs-fixer list-files --config=.php-cs-fixer.dist.php | xargs -n 250 -P 3 vendor/bin/php-cs-fixer fix --diff --config=.php-cs-fixer.dist.php | |
- name: Commit changed files | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
if: env.writable == 1 | |
with: | |
commit_message: Apply php-cs-fixer changes | |
commit_user_name: rex-bot | |
commit_user_email: [email protected] | |
- name: Check code style | |
if: env.writable == 0 | |
run: vendor/bin/php-cs-fixer fix --ansi --diff --dry-run --format=checkstyle | cs2pr | |
psalm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
extensions: intl | |
coverage: none # disable xdebug, pcov | |
- name: Composer install | |
uses: ramsey/composer-install@v2 | |
with: | |
composer-options: --ansi --prefer-dist | |
- name: Run psalm analysis | |
run: vendor/bin/psalm --show-info=false --shepherd --diff --output-format=github |