Make job matrix reusable#115
Merged
danielocfb merged 1 commit intoAug 16, 2022
Merged
Conversation
We run tests in various configurations: on x86_64 and s390x, with gcc and clang toolchains. To define the setups to use we rely on the job matrix feature of GitHub Actions [0]. In the future we would like to run the selftests in parallel in an attempt to minimize overall CI runtime. As a first step towards getting there, we want the running of selftests to be a separate job after the building step. Both running and building need to honor the job matrix, but GitHub Actions does not allow us to simple configure the same matrix for multiple jobs. In order to make that possible, this change uses the job output feature to "generate" the matrix, which can subsequently be used from various locations (including different jobs). To make that work in the job context, we now have to define the matrix in JSON and then decode it when setting. The approach is inspired by the corresponding community discussion [1]. As a side note, having the matrix "generated" like this is also the only way I am aware of with which we can address the feedback received [2] about potential conditional usage of self-hosted runners, depending on which repository a GitHub Actions run is initiated from. [0] https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs [1] https://github.com/orgs/community/discussions/26284 [2] kernel-patches#103 Signed-off-by: Daniel Müller <deso@posteo.net>
mykola-lysenko
approved these changes
Aug 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We run tests in various configurations: on x86_64 and s390x, with gcc
and clang toolchains. To define the setups to use we rely on the job
matrix feature of GitHub Actions [0].
In the future we would like to run the selftests in parallel in an
attempt to minimize overall CI runtime. As a first step towards getting
there, we want the running of selftests to be a separate job after the
building step.
Both running and building need to honor the job matrix, but GitHub
Actions does not allow us to simple configure the same matrix for
multiple jobs.
In order to make that possible, this change uses the job output feature
to "generate" the matrix, which can subsequently be used from various
locations (including different jobs). To make that work in the job
context, we now have to define the matrix in JSON and then decode it
when setting. The approach is inspired by the corresponding community
discussion [1].
As a side note, having the matrix "generated" like this is also the only
way I am aware of with which we can address the feedback received [2]
about potential conditional usage of self-hosted runners, depending on
which repository a GitHub Actions run is initiated from.
[0] https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
[1] https://github.com/orgs/community/discussions/26284
[2] #103
Signed-off-by: Daniel Müller deso@posteo.net