I have a job in Github Actions that uses a matrix. I want to run some of the job steps on a custom shell that depends on a matrix variable.
Specifically, the image has a foreign chroot so I can emulate any hardware architecture and run native binaries for it. The custom shell is just a wrapper script around bash which runs the commands in the chroot and with the emulator for the desired target architecture.
The matrix looks about like this:
cross_build:
strategy:
matrix:
job:
- { release: bullseye , arch: armhf , ocaml-version: 4.14.0 , publish: true }
I have tried
shell: bash-${{ matrix.job.arch }} {0}
(bash-$ARCH being the wrapper script), but get an error:
The workflow is not valid. .github/workflows/CI.yml (Line: mmm, Col: nn): Unrecognized named-value: 'matrix'.
If I hardcode the architecture in the shell, everything works:
shell: bash-armhf {0}
So the issue really is about resolving variables in the shell element.
Is there a way to pass a variable in this place so that different instances of the job run on different custom shells?
If not, I would need to have one bash-wrapper script and somehow pass it the information about the target platform I would like to use. A command line argument is presumably not an option if I can’t pass variables in shell – so what is the standard way of passing that information to the custom shell?
shellpasses verification. Github rejects it nonetheless.shelldoesn't take custom arguments at the moment.