I'm trying to setup a pipeline using Gitlab CI and PHP/Symfony project. My .gitlab-ci.yml
file should contain 3 stages:
- Build - build the image, setup the database, install composer etc
- Tests
- Unit tests
- Other tests (code quality, security checks)
I have it working as it should at the moment, but only by running the build steps alongside each test - this means I'm repeating the same build steps twice and it's taking longer than it should.
I know that GitLab allows you to build a Docker image and store it in the project, but for the time being, is there a mechanism to build the Docker image, store it (as an artifact?), and then pass it onto the test stages so they don't need to repeat the build?