Skip to main content

Running GrumPHP tasks in parallel

06 Jun 2020
Tags: grumphp parallel

Last week, we launched a new version of GrumPHP (0.19.0). One of the main new features inside this release is the ability to run your tasks in parallel. This feature will save you a lot of waiting, both during pre-commit and on the CI environments!

How do I get this madness to work?

Actually, you don't have to do anything! Parallel task execution is enabled by default. All tasks will run in parallel, unless you specify a different priority on a task. This way, you can specify parallel groups inside your configuration. Imagine following setup:

# grumphp.yaml

grumphp:
  tasks:
    phpcs:
      standard: PSR2
    phpunit: ~
    clover_coverage:
      clover_file: 'test/clover.xml'
      metadata:
        priority: -10

This configuration will run both `phpunit` and `phpcs` in parallel since they are both in priority group 0. When both tasks are ready, the `clover_coverage` task is started

Enjoy and let me know what you think of it!

whois VeeWee

Selfie

Hi there!

Glad you made it to my blog. Please feel free to take a look around. You will find some interesting stuff, mostly about web development and PHP.

Still can't get enough of me? Quick! Take a look at my Speakerdeck, Twitter, PHPC.Social, or Github account.