Named Runners

Github Actions provides the ability to use human-readable runner names, and Currents displays these in the dashboard, allowing you to see which runner executed each spec file.

The typical method for creating a matrix strategy for runners in Github Actions is as follows:

matrix:
    shard: [1/3, 2/3, 3/3]

However, there are several ways to achieve this, such as naming the machines with human-readable names like this:

matrix:
    include:
        - runner_name: "Runner 1"
	    shard: 1/2
	- runner_name: "Runner 2"
      	    shard: 2/2

This creates jobs that looks like this in Github Actions:

Named Runners

The final step is to visualize this in the Currents dashboard, which can be done by passing the runner name into the CURRENTS_MACHINE_ID environment variable:

The machineId will now be visible in the Currents dashboard for each spec file, making it possible to identify which machine or job executed a specific spec file.

Spec file details view

Here is a complete example of a Github Action yaml file with this setup:

workflow.yaml

It is also possible to add a dynamic number of named runners by including an extra job in the workflow:

It is only needed to update run: echo "SHARDS=5" >> $GITHUB_ENV into the shards number is required.

A complete example can be found here:

dynamic-runners-workflow.yaml

Last updated

Was this helpful?