Should I use jobs or steps for running different tools? #26587
-
I have a python project where I want to use GitHub actions for code quality checks. I want to use several tools such as isort,black,mypy and pylint. Should I run the commands as steps of a job, or separate jobs ? what is the pros and cons of each approach? @brightran |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It depends on your code/workflow really. Jobs run isolated from each other so there’s no easy way for them to interact, meaning that if your testing tools rely on the output from each other then it will likely not be a good fit. Jobs do run in parallel though, so if your tests take a long time to complete then this may speed up your workflow overall. Be aware that this means you’ll need to checkout a fresh copy of your repository code on each job, along with setting up and installing any required dependencies, so this may end up taking longer. If it’s just a small project then simpler is usually better so I’d recommend a single job with multiple steps. |
Beta Was this translation helpful? Give feedback.
It depends on your code/workflow really. Jobs run isolated from each other so there’s no easy way for them to interact, meaning that if your testing tools rely on the output from each other then it will likely not be a good fit.
Jobs do run in parallel though, so if your tests take a long time to complete then this may speed up your workflow overall. Be aware that this means you’ll need to checkout a fresh copy of your repository code on each job, along with setting up and installing any required dependencies, so this may end up taking longer.
If it’s just a small project then simpler is usually better so I’d recommend a single job with multiple steps.