Adding .gitlab-ci.yml to our example project

We've added tests to our ROT13Formatter project, but now we need to get those tests to be automatically executed in GitLab (either GitLab.com or our own hosted instance). To do this, let's create a file called .gitlab-ci.yml in our project and add the following to it:

before_script:  - apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ca-certificates git php php-xml  - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"  - php composer-setup.php  - php composer.phar installphpunit:  script:    - vendor/bin/phpunit tests/ROT13FormatterTest

This exact file was discussed in the previous section, so we know that it simply executes a series of commands to configure ...

Get GitLab Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.