Skip to content

Commit 3d927ba

Browse files
author
Sam Eagen
committed
Add arm macs as a supported platform in the run-matlab-command task
1 parent 87400ef commit 3d927ba

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tasks/run-matlab-command/v1/matlab.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function runCommand(command: string, platform: string, architecture
3636
}
3737

3838
export function getRunMATLABCommandScriptPath(platform: string, architecture: string): string {
39-
if (architecture !== "x64") {
39+
if (architecture !== "x64" && !(platform === "darwin" && architecture === "arm64")) {
4040
const msg = `This task is not supported on ${platform} runners using the ${architecture} architecture.`;
4141
throw new Error(msg);
4242
}
@@ -49,7 +49,11 @@ export function getRunMATLABCommandScriptPath(platform: string, architecture: st
4949
break;
5050
case "darwin":
5151
ext = "";
52-
platformDir = "maci64";
52+
if (architecture === "x64") {
53+
platformDir = "maci64";
54+
} else {
55+
platformDir = "maca64";
56+
}
5357
break;
5458
case "linux":
5559
ext = "";

tasks/run-matlab-command/v1/test/matlab.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,18 @@ export default function suite() {
9292
});
9393

9494
describe("ci bin helper path", () => {
95-
const testBin = (platform: string, subdirectory: string, ext: string) => {
96-
it(`considers the appropriate rmc bin on ${platform}`, () => {
97-
const architecture = "x64";
95+
const testBin = (platform: string, architecture: string, subdirectory: string, ext: string) => {
96+
it(`considers the appropriate rmc bin on ${platform} ${architecture}`, () => {
9897
const p = matlab.getRunMATLABCommandScriptPath(platform, architecture);
9998
assert(path.extname(p) === ext);
10099
assert(p.includes(subdirectory));
101100
});
102101
};
103102

104-
testBin("linux", "glnxa64", "");
105-
testBin("win32", "win64", ".exe");
106-
testBin("darwin", "maci64", "");
103+
testBin("linux", "x64", "glnxa64", "");
104+
testBin("win32", "x64", "win64", ".exe");
105+
testBin("darwin", "x64", "maci64", "");
106+
testBin("darwin", "arm64", "maca64", "");
107107

108108
it("errors on unsupported platform", () => {
109109
assert.throws(() => matlab.getRunMATLABCommandScriptPath("sunos", "x64"));

0 commit comments

Comments
 (0)