Create matrix with multiple OS and env for each one #25468
-
I’m trying to create something that share the same commands, and each OS can configure the commands via env variables. Is such thing possible ? I’m trying with this approach but it’s failing:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I am very glad to see you here. According to your scenario, I would suggest you use including configurations in a matrix build. You can set os as matrix and then use include keyword to specify TARGET, COMPILER and LINKER. In steps, you can use ${{ matrix.TARGET }} to get the value. Please check the example, it will create three jobs::
For matrix syntax, please refer to this official document: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @yanjingzhu |
Beta Was this translation helpful? Give feedback.
-
Just tested this configuration and have to say it does not work. Take a look at screenshots: Both jobs are |
Beta Was this translation helpful? Give feedback.
-
Correct workflow is:
Do not add |
Beta Was this translation helpful? Give feedback.
-
As far as I’ve seen in a little experiment on my own, using the same key multiple times under @sergeyklay’s solution to use
|
Beta Was this translation helpful? Give feedback.
Correct workflow is:
Do not add
os
as proposed above