Skip to content

Commit a2bda10

Browse files
authored
Set MW_BATCH_LICENSING_ONLINE to true (#70)
* Set MW_BATCH_LICENSING_ONLINE to true * Styling touch ups * Add test to verify env vars are properly set
1 parent 5ceaeee commit a2bda10

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/bat.yml

+16
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,19 @@ jobs:
8888
[~, f] = fileparts(pwd);
8989
assert(strcmp(f, 'subdir'));
9090
startup-options: -sd subdir
91+
92+
- name: Verify environment variables make it to MATLAB
93+
uses: ./
94+
with:
95+
command: exp = 'my_value', act = getenv('MY_VAR'), assert(strcmp(act, exp), strjoin({act exp}, '\n'));
96+
env:
97+
MY_VAR: my_value
98+
99+
# Remove when online batch licensing is the default
100+
- name: Verify MW_BATCH_LICENSING_ONLINE variable set
101+
uses: ./
102+
with:
103+
command: exp = 'true', act = getenv('MW_BATCH_LICENSING_ONLINE'), assert(strcmp(act, exp), strjoin({act exp}, '\n'));
104+
env:
105+
MY_VAR: my_value
106+

src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ async function run() {
1717
const startupOpts = core.getInput("startup-options").split(" ");
1818

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

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

0 commit comments

Comments
 (0)