Runner won't run anything after composer install
I can't be sure whether this is a bug in GitLab CI or GitLab Runner. Also this is the first time I'm trying to use GitLab CI.
In my PHP project I use this .gitlab-ci.yml file (I simplified it a bit to what is necessary):
codesniffer:
script:
- composer install
- '"./vendor/bin/phpcs" -p'
The runner successfully installs dependencies using composer and then instead of running the actual script that checks something marks the build as successful. The second command is not executed at all (even if I replace it with for example "ls").
After some trial and error I managed to fix the issue using some workarounds. First I tried to append the second command using &&. That worked but for whatever reason the working directory was different after composer install. It changed to the location where my gitlab-ci-multi-runner-windows-amd64.exe file is located. So I saved the working directory to a variable and added cd between the commands. This .gitlab-ci.yml works fine:
codesniffer:
script:
- set directory=%cd%
- 'composer install && cd %directory% && "./vendor/bin/phpcs" -p'