Skip to content

Commit 971d823

Browse files
authored
Merge pull request #64 from matlab-actions/hide-mbatch
Do not highlight matlab-batch in log
2 parents 14ae9cb + db478c8 commit 971d823

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

.github/workflows/bat.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ jobs:
4747
with:
4848
release: ${{ matrix.release }}
4949
- name: Run Sample MATLAB Command
50-
run: matlab -batch "${{ matrix.command }}"
50+
uses: matlab-actions/run-command@v1
51+
with:
52+
command: ${{ matrix.command }}

src/install.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ export async function install(platform: string, release: string, skipActivationF
2525
);
2626
}
2727

28-
// Invoke ephemeral installer to setup a MATLAB on the runner
29-
await core.group("Setting up MATLAB", () =>
30-
script
28+
// Set up MATLAB and matlab-batch
29+
await core.group("Setting up MATLAB", () => {
30+
const matlabResult = script
3131
.downloadAndRunScript(platform, properties.ephemeralInstallerUrl, [
3232
"--release",
3333
release,
3434
skipActivationFlag,
3535
])
36-
.then(ematlab.addToPath)
37-
);
36+
.then(ematlab.addToPath);
3837

39-
const batchInstallDir = matlabBatch.installDir(platform);
38+
const batchInstallDir = matlabBatch.installDir(platform);
4039

41-
await core.group("Setting up matlab-batch", () =>
42-
script
40+
const batchResult = script
4341
.downloadAndRunScript(platform, properties.matlabBatchInstallerUrl, [batchInstallDir])
44-
.then(() => core.addPath(batchInstallDir))
45-
)
42+
.then(() => core.addPath(batchInstallDir));
43+
44+
return Promise.all([matlabResult, batchResult]);
45+
});
4646
return;
4747
}

src/install.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ describe("install procedure", () => {
5959
it("rejects when executing the command returns with a non-zero code", async () => {
6060
downloadAndRunScriptMock
6161
.mockResolvedValueOnce(undefined)
62-
.mockRejectedValueOnce(Error("oof"));
62+
.mockRejectedValue(Error("oof"));
6363

6464
await expect(doInstall()).rejects.toBeDefined();
65-
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(2);
65+
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(3);
6666
expect(addToPathMock).toHaveBeenCalledTimes(0);
6767
expect(core.group).toHaveBeenCalledTimes(2);
6868
});
@@ -72,7 +72,7 @@ describe("install procedure", () => {
7272
addToPathMock.mockRejectedValueOnce(Error("oof"));
7373

7474
await expect(doInstall()).rejects.toBeDefined();
75-
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(2);
75+
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(3);
7676
expect(addToPathMock).toHaveBeenCalledTimes(1);
7777
});
7878

0 commit comments

Comments
 (0)