Is it possible to use a stage name instead of the job name to make a job dependent on another job?
stages:
- build
- deploy
- tests
build-job:
stage: build
deploy-feature:
stage: deploy
except:
- master
when: manual
deploy-prod:
stage: deploy
only:
- master
when: manual
test-cases:
stage: tests
dependencies: deploy-feature
That is, instead of using "deploy-feature" can I by any chance use "deploy" to make the test-cases job depend on both deploy-feature and deploy-prod jobs? I know that it doesn't work in dependencies but is there anything else with which it might work?
P.S. My motive is to run my test-cases job only after any one of the deploy-feature or deploy-prod jobs is successful. As currently, my "deploy" jobs are manual and the "test" job isn't so my "test-cases" job gets executed beforehand. I can do a "when: manual" in my test-cases job as well and can run it manually after my deploy job but to me, that feels like a workaround and not a solution. And I have around 17 "tests" jobs so having 2 different jobs for every test-case job is also not a feasible idea.
Edit: Although I have accepted an answer, even then if anyone has something more to add or any different solution please do share.