-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use case: build matrix for 32bit and 64 bit #40
Comments
Hi @lazka! I have thought about that, but the issue is that there are too many possibilities and it can be overwhelming. The principle is really simple: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy strategy:
fail-fast: false
max-parallel: N
matrix:
OBJECT/STRUCT_OR_LIST_OF_OBJECTS/STRUCTS So, the most basic syntax is the one used in https://github.com/msys2/MINGW-packages/blob/master/.github/workflows/main.yml#L12-L18: matrix:
include:
- msystem: MINGW64
msystem_lower: mingw64
arch: x86_64
- msystem: MINGW32
msystem_lower: mingw32
arch: i686 Where you use the values as It can be rewritten as follows: matrix:
task: [
{ msystem: MINGW64, msystem_lower: mingw64, arch: x86_64 },
{ msystem: MINGW32, msystem_lower: mingw32, arch: i686 }
] This is equivalent, but values are used as At the same time, any of the parameters defined in the matrix can be used "anywhere", meaning any field of the YAML. Examples:
As a result, I am not sure about putting all this in the README, because I don't want to duplicate GitHub Actions' docs. Instead, I think it would be desirable to add just some short comment that links to the docs and to https://github.com/msys2/MINGW-packages/blob/master/.github/workflows/main.yml as a "living example". BTW, That last workflow is also interesting because the same tool is tested/built on MINGW64/MINGW32 and with gtk2/gtk3, i.e. four jobs are generated from the matrix: https://github.com/umarcor/gtkwave/blob/ci-msys2/.github/workflows/build.yml#L16-L20 (gtkwave/gtkwave#20). Moreover, packages are automatically updated to a pre-release, as assets/artifacts. |
ok, sounds good too. In case that wasn't clear, I just wanted a small example to show one way, so users see that it's possible.
I've filed msys2/MSYS2-packages#2040 (but not sure if it's worth the effort) |
Thank you! |
A common CI use case is building your project for 32bit and 64bit, which in the setup-msys2 case also means the package names passed to "install" are different, and then in bash depending on the build do something different maybe.
I'd like to see an example for this in the README.
The text was updated successfully, but these errors were encountered: