generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.3 KB
/
rector.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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