CI Pipeline
CI Pipeline
Section titled “CI Pipeline”.github/workflows/ci.yml runs for pull requests into master, explicit manual dispatches, and reusable calls from Delivery. Delivery passes the selected immutable source commit and requires the full suite before Release Please or container publication. This covers direct pushes, administrator merges, manual release requests, and tag recovery without relying on branch protection alone.
CI is intentionally secret-free and fork-safe. Actions are commit-SHA pinned, checkout credentials are not persisted, permissions are scoped per job, event values are passed to shells through environment variables, and every job has a timeout.
Required jobs
Section titled “Required jobs”| Job | Contract |
|---|---|
| Classify pull request | Detect and validate exact same-repository Release Please metadata-only updates |
| Frontend build and dependency audits | PHP 8.5.12, Node 26.12.1, runtime version verification, Composer install/audit, production npm audit, JS unit tests, Vite build, and docs link checks |
| Static checks | PHP 8.5.12, Composer install, parallel Pint formatting, stable/edge installer fixtures, and Compose/Swarm/shell validation |
| Extension lifecycle | Installed extension contract validation and composer test:extensions against the built frontend assets |
| Pest suite (1..4/4) | Sharded parallel Pest runs on PHP 8.5.12 with OPcache CLI enabled and built frontend assets restored |
| Workflow security | Test the required-check policy and check every workflow with checksum-pinned actionlint and zizmor |
| Documentation production build | Install the separate docs lockfile on Node 22.23.4, check generated docs/links, and build Astro before merge |
| Conventional PR title | Validate the current GitHub title after the separate metadata automation normalizes it; skipped outside pull requests |
| required | Stable CI / required branch-protection aggregator |
Application boot uses SQLite, array cache/session/mail, sync queues, null broadcasting, and disabled optional observability. Pest then uses its isolated SQLite file and test-specific overrides from phpunit.xml and tests/Pest.php. Composer downloads and both npm lockfiles have separate caches. The application Node runtime matches both production Dockerfiles; documentation retains its own patched Node 22 toolchain.
Delivery owns the multi-architecture container build and registry credentials. CI builds the frontend/SSR bundle for tests; Delivery builds production images only after validation. The frontend build precedes both Pest and extension lifecycle tests because HTTP tests render Vite-backed views. The path-filtered Pages workflow rebuilds the same documentation source, checks generated docs/links, and publishes only from master.
Standalone module registry validation runs in the separate
KoAkademy module registry
repository. Its CI checks registry.json and packages.json consistency on
pull requests, while pushes to master additionally verify the Ed25519
signature. The Pages workflow repeats both checks before publishing. Registry
contributors never need access to the private signing key.
Release Please pull requests use a fast path because they do not change application code. The classifier accepts only the same-repository Release Please branch with exactly three modified, non-renamed files: .release-please-manifest.json, CHANGELOG.md, and version.json. It checks matching stable versions, the generated PR title, and the changelog entry. Additional files, renames, or deletions restore the full suite. Delivery and manual dispatches never use this fast path.
The required job evaluates .github/ci-required.jq. It accepts skipped validation jobs only for the validated release-metadata PR path, and a skipped title job only outside pull requests. Missing, failed, cancelled, or unexpectedly skipped jobs fail closed. bash tests/ci-required.sh tests this policy without application dependencies. Recovery audits workflows and the gate policy from the current workflow revision while application/docs checks use the selected historical source.
Reproduce locally
Section titled “Reproduce locally”composer installnpm cicomposer audit --locked --abandoned=reportbash scripts/audit-production-deps.shvendor/bin/pint --testnpm run test:email-canvasnpm run test:enrollment-workflownpm run test:grade-status-labelsbash tests/ci-required.shbash tests/installer-release.sh stablebash tests/installer-release.sh edgenpm run buildphp artisan test --parallel --compactnpm run docs:checknpm --prefix docs cinpm --prefix docs run buildKOAKADEMY_ENV_FILE=.env.production.example \ docker compose --env-file .env.production.example -f compose.production.yaml config --quietfor script in docker/start-container docker/healthcheck docker/pulse-process \ docker/nightwatch-process docker/run-scripts.sh docker/docker-scripts/*.sh; do sh -n "$script"donefor script in scripts/install.sh scripts/koakademy scripts/check-release-assets.sh \ scripts/generate-version-metadata.sh scripts/audit-production-deps.sh \ tests/installer-release.sh tests/ci-required.sh; do bash -n "$script"doneshellcheck scripts/install.sh scripts/koakademy scripts/koakademy-app-entrypoint.sh \ scripts/check-release-assets.sh scripts/generate-version-metadata.sh \ scripts/audit-production-deps.sh tests/installer-release.sh tests/ci-required.sh \ tests/Fixtures/installer/docker tests/Fixtures/installer/curl tests/Fixtures/installer/ssdocker compose --env-file tests/Fixtures/installer/swarm-stack.env \ -f scripts/swarm-stack.yml config --quietdocker compose --env-file tests/Fixtures/installer/swarm-stack.env \ -f scripts/swarm-stack-direct.yml config --quietset -asource tests/Fixtures/installer/swarm-stack.envset +adocker stack config --compose-file scripts/swarm-stack.yml >/dev/nulldocker stack config --compose-file scripts/swarm-stack-direct.yml >/dev/nullRun a focused test while iterating:
bash tests/ci-required.shphp artisan test --compact --filter="shows the setup screen"Maintainer notes
Section titled “Maintainer notes”- Branch protection: require only
CI / required; individual job names can evolve without changing repository settings. - No secrets: do not add registry credentials or deployment side effects to CI. Privileged publication stays in Delivery.
- Forks: pull-request validation remains secret-free and never publishes artifacts. Reusable CI receives no inherited secrets from Delivery.
- PR titles: the metadata-only
pull_request_targetworkflow may read the title, description, labels, and changed-file names to infer a Conventional Commit type and scope. It never checks out or executes contributor code. Maintainers should review the inferred title because it controls release notes and SemVer. - Release ordering: Delivery reruns the full suite on the exact source commit before maintaining Release Please or publishing edge/stable images. Builds, replication, and promotion all depend on this gate.
- Production approval: stable finalization uses the
productionenvironment; edge finalization usescontainer-publishing. Configure required reviewers and protected-branch restrictions onproductionin GitHub. Delivery verifies those rules before stable publication and fails closed if they are absent or unreadable. - Repository setup: require
CI / requiredformaster, require PR reviews, and review administrator bypass policy in GitHub. These settings are not controlled by workflow YAML. - Existing quality debt: repository-wide ESLint/Prettier, PHPStan, and strict Composer validation are not introduced as new blocking checks here. Production npm audit is blocking at high/critical severity; resolve unrelated lint/static-analysis debt before adding those gates.
- Docker runtime audit:
scripts/audit-production-deps.shaudits the same--omit=dev --omit=optionaldependency tree shipped by the production Dockerfiles. It retries registry failures and fails closed for high or critical findings. This does not cover build-time or optional dependencies, or installations that retain them.picomatchremains vulnerable to CVE-2026-112366 during builds; no patched version is available. Do not pass untrusted glob patterns to build tooling, and upgrade once a fix is released.
