According to both the CI documentation and the YAML linter the stages: section only accepts string labels. The jobs you can define arbitrarily in the YAML file are then supposed to define which stages they’re meant to run in.
The other way round, however, is not allowed: It’s not possible to define a list of jobs in a stages: subsection to define which jobs should execute in this specific stage. - I’m asking because we’ve identified that that way of defining things more closely resembles programming (think of the jobs as subroutines or functions).
image: some-docker-registry/some-docker-image
cache:
paths:
- node_modules/
before_script:
- echo "Do something ..."
stages:
pre-requisites:
- npm_install
checks:
- phplint
- php-cs-fixer
- phpcs
- phpcbf
- jscs
test:
- phpunit
- grunt
grunt:
script:
- grunt test
npm_install:
script:
- npm install
php-cs-fixer:
script:
- vendor/bin/php-cs-fixer fix -v --config-file=.php_cs
phpunit:
script:
- dev/bin/run_fastest --no-cache-clear
jscs:
script:
- node_modules/grunt-jscs/node_modules/jscs/bin/jscs -c .jscsrc --fix
...
Is this or a similar solution definitely impossible? Or is there an alternative way to get to the same result?
Is there a specific reason for this design decision?