diff --git a/.github/guid-index.json b/.github/guid-index.json index 30144eaf..91cb96b4 100644 --- a/.github/guid-index.json +++ b/.github/guid-index.json @@ -979,7 +979,7 @@ "path": ".github/workflows/reusable-ci.yml", "guid": "reusable-ci-2025-09-24-core-workflow", "title": "Reusable CI Workflow", - "version": "1.20.1", + "version": "1.21.0", "header_path": ".github/workflows/reusable-ci.yml", "path_mismatch": false }, diff --git a/.github/workflows/reusable-ci.yml b/.github/workflows/reusable-ci.yml index ab2732eb..9ab61d9a 100644 --- a/.github/workflows/reusable-ci.yml +++ b/.github/workflows/reusable-ci.yml @@ -1,7 +1,7 @@ # file: .github/workflows/reusable-ci.yml -# version: 1.20.1 +# version: 1.21.0 # guid: reusable-ci-2025-09-24-core-workflow -# last-edited: 2026-11-06 +# last-edited: 2026-11-07 name: Reusable CI Workflow @@ -59,6 +59,16 @@ on: required: false type: boolean default: false + run-frontend: + description: >- + Run the frontend jobs (frontend-npm-cache and frontend-ci). Set false + when the caller installs, builds and tests its frontend itself, e.g. + through its own script, so this workflow's own `npm ci` never runs. + Forces the `frontend-files` output to false. Same name and meaning + as reusable-ci-minimal.yml's run-frontend. + required: false + type: boolean + default: true skip-linting: description: 'Skip linting' required: false @@ -371,6 +381,7 @@ jobs: RUST_HIT: ${{ steps.changes.outputs.rust_files || steps.inventory.outputs.rust_files }} PYTHON_HIT: ${{ steps.changes.outputs.python_files || steps.inventory.outputs.python_files }} FRONTEND_HIT: ${{ steps.changes.outputs.frontend_files || steps.inventory.outputs.frontend_files }} + RUN_FRONTEND: ${{ inputs.run-frontend }} run: | tracked() { [[ -n "$(git ls-files -- "$1")" ]] @@ -396,6 +407,10 @@ jobs: python=false fi frontend="${FRONTEND_HIT:-false}" + if [[ "$frontend" == true && "$RUN_FRONTEND" != true ]]; then + echo "frontend_files: run-frontend is false, not running frontend-ci" + frontend=false + fi if [[ "$frontend" == true ]] && ! tracked "$frontend_manifest"; then echo "frontend_files: no $frontend_manifest, not running frontend-ci" frontend=false diff --git a/changelog.d/20261107-reusable-ci-run-frontend.md b/changelog.d/20261107-reusable-ci-run-frontend.md new file mode 100644 index 00000000..0ac22f17 --- /dev/null +++ b/changelog.d/20261107-reusable-ci-run-frontend.md @@ -0,0 +1,16 @@ +### Added + +#### `reusable-ci.yml` gains a `run-frontend` input to skip the frontend jobs + +`reusable-ci.yml` had no way to skip its frontend half; only +`reusable-ci-minimal.yml` had `run-frontend`. A caller that installs its web +dependencies through its own script (for example because the frontend depends +on a sibling workspace package that a plain `npm ci` cannot resolve) still got +`frontend-npm-cache` and `frontend-ci` running their own install. + +`run-frontend` (boolean, default `true`, same name and meaning as in the minimal +workflow) is applied in the change-detection gate: when `false`, the +`frontend-files` output is forced to `false`, so `frontend-npm-cache` and +`frontend-ci` are skipped through their existing `if:` conditions. `ci-summary` +already maps a skipped frontend job to `skipped`, which is not a failure. The +default keeps every existing caller's behaviour unchanged.