This commit is contained in:
gaofeng
2026-05-13 10:44:29 +08:00
commit 0b165153c6
3674 changed files with 316663 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
name: build
on:
push:
branches:
- "8.x"
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, 8.2, 8.3, 8.4]
name: PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-dist --no-interaction --prefer-stable --no-suggest
- name: Execute tests
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Upload Scrutinizer coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"

View File

@@ -0,0 +1,31 @@
name: PHP CS Fixer
on:
pull_request:
branches:
- "8.x"
paths:
- '**.php'
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: cs2pr,php-cs-fixer
- name: Run PHP CS Fixer
run: |
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- '*.php')
for file in $changed_files; do
php-cs-fixer fix "$file" --dry-run --diff --rules=@PER-CS2.0 --format=checkstyle | cs2pr
done