Added Rector Badge #2
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: Rector CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
rector: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Setup PHP environment | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
extensions: mbstring, xml, tokenizer, curl, json | |
tools: composer | |
coverage: none | |
# Cache dependencies | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
# Install dependencies | |
- name: Install dependencies | |
run: composer install --no-progress --no-suggest --prefer-dist | |
# Cache Rector | |
- name: Cache Rector cache | |
uses: actions/cache@v3 | |
with: | |
path: .rector/cache | |
key: ${{ runner.os }}-rector-${{ hashFiles('**/rector.php') }} | |
restore-keys: ${{ runner.os }}-rector- | |
# Run Rector | |
- name: Run Rector | |
run: | | |
vendor/bin/rector process \ | |
--ansi | |
# Optional: Fail if Rector suggests changes | |
- name: Validate Rector changes | |
run: | | |
git diff --exit-code |