-
Let’s consider the following workflow:
Currently the macos job will fail because: “##[error]File not found: ‘docker’”. What I would want to see is: the macos job would run on macos VM and ubuntu job would run in container. I know I can workaround this by making 2 separate jobs but I would need to repeat myself and would rather avoid that, granted that this workflow is simple and I can do it easily but it is just an example. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
I definitely understand the motivation here. I’m not sure that just ignoring the container key on macOS runs will necessarily be the solution, but we’ll look at how to simplify this for you so that it’s more DRY. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to say this would be very helpful for us as well. Is there anyway currently we can write the yaml so that the container field is included conditionally, only for the linux builds? That would basically solve the issue for us I think. |
Beta Was this translation helpful? Give feedback.
-
Yes, the solution here would be for GitHub Actions to allow something like:
for example. This problem is compounded by the fact that Yaml anchors are not supported - further forcing us to duplicate CI specification code. |
Beta Was this translation helpful? Give feedback.
-
@pmatos I like your suggestion! It’s concise, clear, explicit, and consistent. @ethomson what do you think? |
Beta Was this translation helpful? Give feedback.
-
For the record, I have exactly the same problem and would really enjoy a solution, like what @pmatos suggests! |
Beta Was this translation helpful? Give feedback.
-
@ethomson any update on this? |
Beta Was this translation helpful? Give feedback.
-
Hi all, The idea was to build this kind of matrix:
Working on this implementation:
The way you build the matrix json depends on your specific needs. But I couldn’t make it work. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. @ethomson Any update? This practically not being supported forces anyone who needs to support executing items both in and outside containers to copy and paste all of their jobs, which is silly. Either adding support for an if keyword to the container keyword or adding support for Yaml Anchors, as @pmatos wrote, would solve this issue for me. Solving actions/runner#646 might also help. At least you wont have to copy all of your steps from job to job, as you could wrap all of your steps inside a composite action, but that feels like a bit of a band-aid. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Allow an empty value to be specified for jobs.<id>.container
**Is your feature request related to a problem? Please describe.** I'd like t…o be able to build a matrix workflow where some jobs run in a container and some run directly on the VM. I may have a cross-platform tool where I have strange dependencies that I provide via a container, or I want to run on multiple different Linux distributions, but also run on Windows and macOS. So I would like a way to specify that I run on no container. This would allow me to create a workflow like: name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image: ['ubuntu:latest', 'centos:latest', ''] A more realistic scenario would be a matrix of Describe the solution you'd like |
Beta Was this translation helpful? Give feedback.
Allow an empty value to be specified for jobs.<id>.container