A First CI Pipeline for a Laravel Project

A First CI Pipeline for a Laravel Project

21 October 2026 · By Laravel Git · 2 min read

CI does not need to be elaborate to be valuable. For a small Laravel team, a first pipeline is four jobs that run on every pull request, and its real product is a green checkmark everyone trusts.

The four jobs#

  1. Install: composer install and npm ci. If dependencies cannot install cleanly from the lockfiles, nothing else matters - this is why the lockfiles are committed.
  2. Lint: ./vendor/bin/pint --test fails the build on style drift, so style stops being a code review topic.
  3. Test: php artisan test against a throwaway database (SQLite in memory is enough for a first pipeline).
  4. Build: npm run build proves the frontend compiles - the failure you do not want to meet at deploy time.

Any pipeline runner can express this: GitHub Actions, GitLab CI, or the CI your self-hosted setup provides. The shape is the same everywhere: checkout, cache the composer/npm directories, run the four jobs.

Make the check required#

A pipeline nobody is forced to wait for becomes decoration within a month. Wire it into branch protection: pull requests cannot merge until CI is green. That single setting is the difference between “we have CI” and “CI has us” - and it is what lets small PRs move quickly, because reviewers see the robot’s verdict before they spend their own attention.

Keep it boring and fast#

Two traps make teams abandon CI:

  • Slow runs. Cache dependencies, and resist running the full browser-test suite on every push - that belongs in a nightly job. A PR pipeline that answers in under five minutes gets respected; one that takes forty gets bypassed.
  • Flaky tests. A test that fails randomly teaches everyone to click “re-run” without looking, which is worse than no test. Quarantine flakes the week they appear.

What not to automate yet#

Deploys. The first pipeline stops at the green checkmark on the PR; deployment stays a deliberate human act until the test suite earns more trust. When that day comes, the pipeline’s final job is a tag, and Deploy With Tags, Not Branches takes it from there.

Four jobs, one required check, five minutes. That is the whole first pipeline - everything after is refinement.

Share this post

Our network