Split the CI workflow into static analysis and tests
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
调研方向
从头到尾阅读 .github/workflows/php.yml,记下矩阵、Memcached/Redis 服务块、缓存步骤,以及 PHP-CS-Fixer、PHPStan、Rector、测试和覆盖率步骤的顺序。将单个作业拆分为 static-analysis 作业(PHP 8.2,无服务,composer validate --strict 加上三个工具)和 tests 作业,后者保留 8.2/8.3/8.4 矩阵、服务、测试,以及仅在 8.2 上执行的覆盖率上传。另外,将 Composer 缓存按 PHP 版本以 composer.json 为键,并将 actions/checkout 和 actions/cache 升级到 Node.js 24 对应版本,触发器和测试标志保持不变。完成标准是:两个作业都出现在拉取请求中并通过,静态分析只运行一次,覆盖率只上传一次。
由索引模型根据 Issue 内容生成。
描述
Summary
.github/workflows/php.yml runs one job for each PHP version (8.2, 8.3 and 8.4), and each job runs everything in a row: it starts Memcached and Redis, installs the dependencies, runs PHP-CS-Fixer, PHPStan and Rector, runs the tests and uploads the coverage. Split it into a static analysis job that runs once and a test job that runs for each PHP version.
Problems
- Static analysis runs three times with the same result. PHP-CS-Fixer, PHPStan and Rector check the source, not the runtime: PHPStan analyses it as PHP 8.2 (
phpVersion: 80200) and Rector uses the PHP 8.2 level set, whatever PHP runs them. PHPStan is the slowest of them. - A style or analysis failure hides the test result. The steps run in order, so a PHP-CS-Fixer finding stops the job before the tests run.
- The coverage is uploaded three times, once per PHP version.
- The static checks start Memcached and Redis, which they do not use.
- The Composer cache is keyed on
composer.lock, which the repository does not track, so all PHP versions share one cache key. actions/checkout@v4andactions/cache@v4run on Node.js 20, which GitHub is retiring on its runners.
Change
Two jobs in php.yml, which run in parallel:
static-analysis: once, on PHP 8.2, without services:composer validate --strict, PHP-CS-Fixer, PHPStan, Rector.tests: the matrix PHP 8.2, 8.3 and 8.4 with Memcached and Redis: the tests, and the coverage upload from PHP 8.2 only.
Also: a Composer cache key per PHP version based on composer.json, and the Node.js 24 versions of actions/checkout and actions/cache.
The triggers (push to master and *.x, every pull_request) and the test flags (--fail-on-warning --fail-on-risky) stay as they are. Branch protection requires only the Scrutinizer check, so the new job names need no change there.
The change applies from 3.3.0 on, on master; the release lines keep their current workflow.
Out of scope
- Other PHP versions or operating systems in the matrix.
- 主要语言
- PHP
- 星标
- 44
- 派生
- 22
- 平均合并
- 2 小时 57 分钟
- 30 天内合并 PR
- 52
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quantum-php/framework 的其他 Issue
-
routing testing
难度 2/5 1-3 小时 新手友好度 76/100
quantum-php/framework#547 ·
维护者通常 1 天内回复
-
breaking change enhancement
难度 3/5 1-2 天 新手友好度 72/100
quantum-php/framework#715 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
quantum-php/framework#714 ·
维护者通常 1 天内回复
-
refactoring tech debt
难度 4/5 3-5 天 新手友好度 68/100
quantum-php/framework#712 ·
维护者通常 1 天内回复
-
refactoring tech debt
难度 5/5 一周以上 新手友好度 20/100
quantum-php/framework#693 ·
维护者通常 1 天内回复
查看 quantum-php/framework 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
ExpressionEngine/ExpressionEngine#5493 ·
维护者通常 5 天内回复
-
"Attempt to read property 'username' on null" error after a user is deleted可能已有人在做 @dicksonlaw583 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
omeka/plugin-SimplePages#49 ·
-
not confirmed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复