Last updated: 12 November 2026. See the update log at the end.
A Laravel test suite that only runs on your laptop will eventually fail on the server for a reason you cannot reproduce: a missing PHP extension, a different PHP version, or a MySQL behavior that SQLite hides. A CI workflow fixes that by running the same checks in a clean machine on every push and pull request. This is Part 1 of a three-part series on a Laravel pipeline in GitHub Actions:
Part 1 (this article): run the tests on a PHP version matrix with a MySQL service.
Part 2: cache Composer and npm so runs are faster.
Part 3: deploy over SSH with releases, an atomic switch and rollback.
The workflow below passes actionlint and GitHub's workflow schema check, and its shell steps were run locally against a real MySQL server on Laravel 13.40.0.…