-
Notifications
You must be signed in to change notification settings - Fork 1k
parallelize tests on GHA #9921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parallelize tests on GHA #9921
Conversation
| ruby: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby }} | ||
| node: ${{ fromJson(needs.setup_matrix.outputs.matrix).node }} | ||
| postgresql: ${{ fromJson(needs.setup_matrix.outputs.matrix).postgresql }} | ||
| task: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really wish GH would allow include to create a new axis…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if gha-matrix should gain a base-matrix param, which is used a base and then matrix.json is joined therein?
>>> import json
>>> base_matrix_input = '{"task":["a","b","c"]}'
>>> matrix_json = '{"ruby":["2.7","3.0"]}'
>>> matrix = json.loads(base_matrix_input)
>>> matrix.update(json.loads(matrix_json))
>>> matrix
{'task': ['a', 'b', 'c'], 'ruby': ['2.7', '3.0']}
ekohl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we set up node as well, but I don't think it's actually needed for these tasks. It is for some though, which we should add. Kind of related to what I started in theforeman/actions#18.
For foreman.git it'll be simple: we can assume that package.json is present. For plugins we can't, but your approach here leads to a thought: how would the matrix look if we take tasks and their dependencies into account. Would it be easier, or only add more complexity?
|
Another thought: in gha-puppet we have a dummy task at the end which we can add as a required step to verify the whole matrix. Today we don't have the Jenkins task as a required step, but we could add that. Having a single workflow makes that easier so I too prefer this approach to the other ones. |
Is the question "How do we avoid the cost of setting up Node and installing NPM dependencies for the branches that do not test JS things (= all of the existing ones, as we do not call |
I can take a stab at this, let's see if GHA likes colons in ids. Edit: no colons needs, phew |
|
We could introduce rake tasks that fail if no |
cc05c9c to
c855df2
Compare
ekohl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should include the task in the Gemfile.lock filename. It's likely it'll be exactly the same in each task, but not guaranteed. Other than that, 👍 on this.
I debated dropping Node and making these ruby-only tests, but that's for a follow up.
c855df2 to
e672559
Compare
Meh I've taken it out again. GH has no good way to do string substitution inside their templating language :/ |
e672559 to
4a6ddc9
Compare
"yay" |
|
I suspect you each one overwrites the other. https://github.com/theforeman/foreman/actions/runs/6980908724?pr=9923 does produce multiple, but that only has a simple definition right now. |
|
Probably. Shall we merge as-is? |
4a6ddc9 to
9778ba0
Compare


alt to #9920 and #9919