matlab-actions / setup-matlab

Set up your GitHub Actions workflow with a specific version of MATLAB.
BSD 3-Clause "New" or "Revised" License
73 stars 8 forks source link

Document `matlabroot` output #109

Open externl opened 3 months ago

externl commented 3 months ago

It would be convenient to have an option to export the configured MATLAB install directory as an environment variable. It's useful when linking against MATLALB when developing an add-on. AFAICT, right now you kinda have to guess (on Linux at least).

MATLAB 2023b is located at /opt/hostedtoolcache/MATLAB/2023.2.999/x64

mcafaro commented 3 months ago

The action has a matlabroot output that contains the path to the MATLAB root folder.

- name: Setup MATLAB
  id: setup-matlab
  uses: matlab-actions/setup-matlab@v2

- name: Print MATLAB root folder directly
  run: echo ${{ steps.setup-matlab.outputs.matlabroot }}

- name: Print MATLAB root folder from env var
  env:
    MATLAB_ROOT: ${{ steps.setup-matlab.outputs.matlabroot }}
  run: echo $MATLAB_ROOT

I will keep this issue open as a reminder for us to document this output.

externl commented 3 months ago

Thanks @mcafaro, that's exactly what I'm looking for!