Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Matlab executable outside the context of this action #53

Open
externl opened this issue Feb 22, 2024 · 2 comments
Open

Run Matlab executable outside the context of this action #53

externl opened this issue Feb 22, 2024 · 2 comments

Comments

@externl
Copy link

externl commented Feb 22, 2024

Hello, sorry if this isn't the correct place to ask this question. The CI/CD testing of our MATLAB library uses a Python script which calls directly calls the matlab binary (among testing and doing other things). So unfortunately we can't directly use this action.

Calling this, for example, fails

$ echo 'frpintf("Hello world\n");' > hello.m
$/opt/hostedtoolcache/MATLAB/2023.2.999/x64/bin/matlab -batch "hello"

License checkout failed.
License Manager Error -1
The license file cannot be found.

This repository seems to use an intermediary command located at $WORKINGDIR/$os/run-matlab-command$bin_ext. Presumably it configures the license or something?

Is there any workaround we can use to be able to call the Matlab executable directly? Like loading the action and calling this run-matlab-command command?

Thanks.

@externl externl changed the title Run Matlab outside the context of this action Run Matlab executable outside the context of this action Feb 22, 2024
@mcafaro
Copy link
Member

mcafaro commented Feb 22, 2024

Hi @externl,

At the moment, the run-*@v2 actions (i.e. run-command@v2, run-tests@v2, and run-build@v2) are the only supported ways to run and license MATLAB for open source projects with matlab-actions/setup-matlab@v2.

We are considering ways to support shell-based workflows in the future but I do not have anything official to give you now. As you noted, the run actions use a "run-matlab-command" binary behind-the-scenes that you could use as a stopgap for shell-based workflows but please note the "run-matlab-command" binary is undocumented and subject to change in the future.

- name: Setup MATLAB
  uses: matlab-actions/setup-matlab@v2
- name: Get run-matlab-command
  run: |
    wget -O /usr/local/bin/run-matlab-command https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2/glnxa64/run-matlab-command
    chmod +x /usr/local/bin/run-matlab-command
- name: Run MATLAB Command
  run: run-matlab-command "disp('hello world')"

@externl
Copy link
Author

externl commented Feb 23, 2024

Thanks @mcafaro, we'll probably try this workaround for now!

enigne added a commit to enigne/ISSM that referenced this issue Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants