mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2026-09-05 07:27:50 +08:00
- 新增 PHP-CS-Fixer 配置,并保留项目统一文件头。 - 新增 PHPStan 配置与 composer analyse/cs 脚本,删除 minimum-stability: dev。 - GitHub Actions 拆分静态分析、版本矩阵测试和最低依赖测试。 - 忽略 PHPStan 缓存,避免本地分析缓存进入仓库。
86 lines
1.9 KiB
YAML
86 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- '2.0'
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
static-analysis:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
extensions: json, openssl, simplexml
|
|
coverage: none
|
|
|
|
- name: Validate composer metadata
|
|
run: composer validate --strict
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Check coding style
|
|
run: composer cs:check
|
|
|
|
- name: Run static analysis
|
|
run: composer analyse
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version: ['8.1', '8.2', '8.3', '8.4']
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
extensions: json, openssl, simplexml
|
|
coverage: none
|
|
|
|
- name: Validate composer metadata
|
|
run: composer validate --strict
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Run tests
|
|
run: composer test
|
|
|
|
lowest-dependencies:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
extensions: json, openssl, simplexml
|
|
coverage: none
|
|
|
|
- name: Validate composer metadata
|
|
run: composer validate --strict
|
|
|
|
- name: Install lowest dependencies
|
|
run: composer update --prefer-lowest --prefer-stable --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Run tests
|
|
run: composer test
|