Do not use "before_script" or "after_script" here to allow contributors to hook there if needed
Problem/Motivation
https://drupal.slack.com/archives/CGKLP028K/p1699195716277549
Mondrake asked how to do some commands before other commands. That got me thinking. Currently adjusting to your own workflow is hard as contrib. You might need to install stuff that isn't installed by default.
That can usually be achieved easily with "before_script" and "after_script" commands, but we are currently using it in one instance in a crucial place, like the phpunit job, so let's refactor and leave it available.
Steps to reproduce
Proposed resolution
- Clean up "after_script" for .phpunit-base job (both new and D7 main.yml file). We can capture the output of the command into a variable and then return the variable as the last command, same as in the "phpstan" job.
- Clean up the "before_script" for "phpunit (next major)". This one makes sense as people won't extend this.