How to overcome local testing challenges by running GitLab CI via Docker locally?
GitLab Runner can use Docker to run jobs locally on a machine for testing and debugging. This provides you with an inexpensive and efficient way to test jobs before they go into production.
Go through the blog on How To Use GitLab CI To Run Tests Locally? for more detail.