Skip to content
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

Add test grouping to workflow inputs #1029

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

vmilosevic
Copy link
Collaborator

Add option to define test grouping as workflow input.
For example, this will run tests in 4 group

docker-build:
    uses: ./.github/workflows/build-and-test.yml
    secrets: inherit
    with:
      test_mark: 'nightly'
      test_group_cnt: 4
      test_group_ids: '[1,2,3,4]'

@@ -11,3 +11,5 @@ jobs:
secrets: inherit
with:
test_mark: 'nightly'
test_group_cnt: 4
test_group_ids: '[1,2,3,4]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to specify IDs? Is it possible for this to be automatically picked?

Copy link
Collaborator Author

@vmilosevic vmilosevic Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, unfortunately the functions you can use in gihub context are very limited (contains, startsWith, fromJSON, toJSON ..). You can't even get the length of an array.

A way this could be done is to add one more job that can do more complicated things in bash and output the list but I thought this complicates workflow unnecessarily and gone with simpler solution.

You also need to provide matrix values before job is scheduled, so you can't do any manipulation in same job, it needs to be a job that run before.

@vmilosevic vmilosevic merged commit 8aebefb into main Jan 14, 2025
14 checks passed
@vmilosevic vmilosevic deleted the vmilosevic/test_group_input branch January 14, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants