Skip to content

feat: add rtcamp-standard reusable workflow with build-artifact gate and PHPStan#683

Open
Adi-ty wants to merge 10 commits intotheme-elementary-v2from
feature/642-standard-workflow
Open

feat: add rtcamp-standard reusable workflow with build-artifact gate and PHPStan#683
Adi-ty wants to merge 10 commits intotheme-elementary-v2from
feature/642-standard-workflow

Conversation

@Adi-ty
Copy link
Copy Markdown

@Adi-ty Adi-ty commented May 7, 2026

Description

Adds a reusable CI workflow (.github/workflows/rtcamp-standard.yml) that enforces build artifact gating and runs PHPStan static analysis. Also introduces a shared composite action for Node.js setup with node_modules caching.

Technical Details

  • Build artifact gate: Blocks PRs that commit files under assets/build/. Uses FETCH_HEAD diff pattern consistent with pre-run job. Handles renames/copies (--diff-filter=ACMR), strips whitespace from path inputs, and escapes regex metacharacters in paths.
  • PHPStan job: Runs composer phpstan conditionally based on whether PHP-related files changed. Uses fromJSON() coercion for boolean input to avoid string-to-boolean edge cases.
  • Node caching: .github/actions/setup-node-with-cache composite action caches node_modules keyed on package-lock.json + .npmrc + Node version. Used by all Node-dependent jobs.
  • rtcamp-standard is called from test-measure.yml as a reusable workflow.

Checklist

  • .github/workflows/rtcamp-standard.yml created as a reusable workflow
  • PHPStan job runs and fails on new errors (uses phpstan-baseline.neon from TASK-003)
  • Pa11y checks core template pages against WCAG AA
  • Build artifact gate blocks PRs that commit files under assets/build/
  • assets/build/ added to .gitignore
  • All action versions pinned to a specific tag or SHA
  • All new jobs pass on a clean branch

Screenshots

To-do

  • Pa11y job to be added in a follow-up once wp-env setup in CI is finalized.
  • phpstan-baseline\.neon was added to the pre-run PHP file detection regex so baseline-only changes trigger PHPStan.
  • The lint-js job failure is a pre-existing issue — ESLint 9 requires eslint.config.js (flat config) but the repo still uses .eslintrc.*. Unrelated to this PR.

Fixes/Covers issue

Fixes #642

bhavz-10 and others added 10 commits April 16, 2026 00:31
…and PHPStan

Introduces .github/workflows/rtcamp-standard.yml as a reusable workflow exposing two jobs:
  - build-artifact-gate: fails any PR that commits files under assets/build/ (configurable via build-artifact-paths input). Diffs PR head against the base ref and reports offending files with a fix hint.
  - phpstan: runs `composer phpstan` (gated by the run-phpstan input so callers can skip when no PHP files changed).
@Adi-ty Adi-ty force-pushed the feature/642-standard-workflow branch from 26ba591 to ca8a1c3 Compare May 7, 2026 12:12
@Adi-ty Adi-ty changed the title Feature/642 standard workflow feat: add rtcamp-standard reusable workflow with build-artifact gate and PHPStan May 7, 2026
@Adi-ty Adi-ty marked this pull request as ready for review May 7, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants