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 天內回覆