-
When doing matrix testing on multiple platforms one may want to test on a matrix like below: matrix:
os:
- ubuntu-latest
- macos-11
shell:
- bash
include:
- os: windows-latest
shell: wsl-bash {0}
steps:
- name: Activate WSL
if: runner.os == 'Windows'
uses: Vampire/setup-wsl@v1
- name: run something
run: cat /etc/os-release
shell: ${{ matrix.shell }} # <-- apparently GHA issue The problem is that apparently GHA does not allow you use
The error above makes me think that GHA is not really able to use dynamic expressions on It would be very useful to have an example where something like this works cross-platforms, especially as in real life the number of steps is considerably bigger and duplicating each "run" and adding conditions makes the workflow files reach an unmaintainable size. Even splitting them into two and using different jobs for windows and non windows does create similar maintenance challenges. Also posted at https://github.saobby.my.eu.orgmunity/t/unable-to-use-expressions-as-argument-to-shell/226230 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
In case someone else gets into the same issue, I found a solution, using defaults with fallback values can help you switch the default shell. Look at ansible/team-devtools#29 (comment) |
Beta Was this translation helpful? Give feedback.
-
This is more a GitHub issue. Another possible option would be to use as shell a custom script that dynamically decides from |
Beta Was this translation helpful? Give feedback.
-
At least GitHub 1st level supports it is a bug. |
Beta Was this translation helpful? Give feedback.
In case someone else gets into the same issue, I found a solution, using defaults with fallback values can help you switch the default shell. Look at ansible/team-devtools#29 (comment)