Skip to content

Set MW_BATCH_LICENSING_ONLINE to true #70

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

Merged
merged 3 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,19 @@ jobs:
[~, f] = fileparts(pwd);
assert(strcmp(f, 'subdir'));
startup-options: -sd subdir

- name: Verify environment variables make it to MATLAB
uses: ./
with:
command: exp = 'my_value', act = getenv('MY_VAR'), assert(strcmp(act, exp), strjoin({act exp}, '\n'));
env:
MY_VAR: my_value

# Remove when online batch licensing is the default
- name: Verify MW_BATCH_LICENSING_ONLINE variable set
uses: ./
with:
command: exp = 'true', act = getenv('MW_BATCH_LICENSING_ONLINE'), assert(strcmp(act, exp), strjoin({act exp}, '\n'));
env:
MY_VAR: my_value

5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ async function run() {
const startupOpts = core.getInput("startup-options").split(" ");

const helperScript = await matlab.generateScript(workspaceDir, command);
await matlab.runCommand(helperScript, platform, architecture, exec.exec, startupOpts);
const execOpts = {
env: {...process.env, MW_BATCH_LICENSING_ONLINE:'true'} // remove when online batch licensing is the default
};
await matlab.runCommand(helperScript, platform, architecture, (cmd,args)=>exec.exec(cmd,args,execOpts), startupOpts);
}

// Only run this action if it is invoked directly. Do not run if this node
Expand Down