question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matrix Jobs - Sorted for start order?

See original GitHub issue

Describe the enhancement

When running a workflow file, the order of jobs appears to be sorted regarding the starting of jobs.

The jobs as listed on the left side of the web UI appear as they are listed in the matrix. Conversely, jobs seem to actually start based on an alpha sort?

I noticed this when trying to shorten total CI time. The workflow has more than 5 macOS jobs, and one job takes about twice the time that the others take. It also sorts last. If it’s the last job, total test time is 3x. If I can force it to run first, test time would be 2x.

Originally, it was at the end of the matrix. When I moved it to the beginning, nothing changed.

Code Snippet

Original matrix - truffleruby-head is the 2x job and starts last

ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, head, jruby, truffleruby-head ]

Modified matrix - truffleruby-head still starts last, but is listed first in the job list

ruby: [ truffleruby-head, jruby, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, head ]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
denzhelcommented, Sep 9, 2020

I have the same issue as well.

We’re working with Terraform and different workspaces using the same repo:

# Support multiple workspaces
strategy:
   matrix:
      workspace: [dev-us-east-1, stg-us-west-2]

It is documented that order matters, however, it is chosen randomly when I use it:

- name: Change Terraform workspace
      run: terraform workspace select ${{ matrix.workspace }}
      if: steps.check.outputs.triggered == 'true'

Instead of running the Terraform process on dev-XXX first, it runs randomly and sometimes chooses stg-XXX first

2reactions
ericsciplecommented, May 18, 2020

The matrix is generated in a predictable order, based on how the defined order.

Something in the orchestration layer doesn’t respect the order.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using a matrix for your jobs
The order of the variables in the matrix determines the order in which the jobs are created. The first variable you define will...
Read more >
Sort the given matrix
The problem is to sort the given matrix in strict order. Here strict order means that the matrix is sorted in a way...
Read more >
How to order by matrix field?
I want to get my entries ordered by that date field. Is this possible? Pseudocode: {% for entry in craft.entries.section('dates').order( ...
Read more >
Selection Algorithms on Sorted Matrix: A Comprehensive ...
In this matrix, both rows and columns are sorted in ascending order. Now, let's explore the different selection algorithms we can use to...
Read more >
Matrix Column Sort Order
I want my Job Title columns to sort in descending order by number of FTE's (full-time equivalents). In Power Query editor (Transform data),...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found