In this episode, we're setting up a basic GitHub Actions workflow to automatically run our Laravel Dusk tests when we push code to our remote repository.
We start by creating a new environment file specifically for our CI (Continuous Integration) setup, making sure not to hardcode any sensitive values we wouldn't want to commit—though we’ll handle secrets more securely in the next episode. I show you how to set up the .github/workflows
directory with a dusk.yml
file, walking you through each step in the workflow, like checking out the code, setting up MySQL, configuring PHP, dealing with the environment file, installing dependencies, building front-end assets, and then actually running the Dusk tests.
As we progress, we hit a few (very typical!) errors—like database credentials not matching, the app environment set incorrectly, or the URL not being right for CI. Each time, we debug together, update configuration files, commit, and push again, until everything works. I also mention that you can use the act
tool to run these kinds of workflows locally, but for now, we're pushing to GitHub and watching the builds run live.
By the end, we have a working CI process running our Dusk tests in GitHub Actions. It took a bit of trial and error to get everything configured just right, but that’s totally normal! Next time, we’ll focus specifically on handling secrets and making our setup more secure.