Closed H0R5E closed 2 years ago
Hi @H0R5E,
This is expected behavior because the -batch
option disables persistent changes to preferences. Preferences are used to register the installation of a toolbox.
You can find all the effects of using -batch
listed under the input arguments section on this page: https://www.mathworks.com/help/matlab/ref/matlablinux.html
Best, Mark
@mcafaro, so are you saying there is no way to store preferences during a CI run? matlab-actions/run-command
just calls -batch
as well, as far as I can tell.
EDIT: It's not an issue once you know this, as you can just build a super long command or have a script prepared to do everything in one call, but I think it's worth documenting the fact, as my colleagues were stumped for weeks because of successive calls to run-command
not working as expected.
@H0R5E that is right (at least for GitHub-hosted agents). GitHub-hosted agents are currently only licensed for MATLAB execution with the -batch
option, which does not persist preferences between launches. Self-hosted agents have more flexibility over licensing and don't necessarily need to use -batch
.
Reopening to see if we can better highlight this behavior in the doc. Is there a particular place you would have hoped to see this behavior mentioned?
@mcafaro, I think somewhere in the Run MATLAB Command section of the matlab-actions/run-command README would be useful. I'm happy to do a quick PR if that would be helpful.
Mat
@H0R5E, if you are willing to complete an individual CLA (Contributor License Agreement), we would happily review a PR. Otherwise, we have this issue open for tracking. Thanks for bringing it to our attention.
Hi, I was just wondering if the behaviour I am seeing when calling MATLAB in batch mode across multiple steps is expected. For instance, when I combine installing my toolbox and my (basic) test, everything works fine:
However, when I split the installation and the test step it fails:
Is this expected behaviour? The full (working) workflow is as follows: