mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
* Update rector config to include tests * Run Rector against the tests * Delete test-results * Update .gitignore * Correctly set the PHP min to 8.1, split the configs * Corrected PHPDoc * Deleted tests we can't really get to pass PHPunit is hard-coded to fail when a class has a return type of `never`, which is the correct return type of our redirect function (and rightfully so). No way to disable the exception as far as we can tell
60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
name: Rector and Code Styling
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 12 * * 2,4' # Runs once every Tuesday and Thursday
|
|
|
|
jobs:
|
|
php-cs-fixer:
|
|
name: Rector & PHP-CS-Fixer
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
command: validate
|
|
|
|
- name: Cache Composer Dependencies
|
|
id: composer-cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ./src/vendor
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-composer-
|
|
|
|
- name: Install Composer Dependencies
|
|
if: steps.composer-cache.outputs.cache-hit != 'true'
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
php_version: 8.2
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.2'
|
|
|
|
- name: Run Reactor
|
|
run: |
|
|
php src/vendor/bin/rector
|
|
php src/vendor/bin/rector --config=rectorTests.php
|
|
|
|
- name: Run PHP CS Fixer
|
|
run: php src/vendor/bin/php-cs-fixer fix
|
|
|
|
- name: Create a Pull Request
|
|
uses: peter-evans/create-pull-request@v5
|
|
with:
|
|
title: Apply PHP Code Styling & Quality Changes
|
|
commit-message: Apply PHP Code Styling & Quality Changes
|
|
branch: rector-and-CS
|
|
body: Automated run of PHP-CS-Fixer and Rector to ensure code styling, quality, and modern practices.
|
|
delete-branch: true
|
|
token: ${{ secrets.BOT_TOKEN }}
|
|
committer: FOSSBilling Bot <fossbilling-bot>
|
|
author: FOSSBilling Bot <fossbilling-bot>
|
|
labels: skip-changelog
|