-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.ts
More file actions
54 lines (44 loc) · 1.67 KB
/
Copy pathindex.ts
File metadata and controls
54 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2022-2024 The MathWorks, Inc.
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import * as buildtool from "./buildtool.js";
import { matlab, testResultsSummary, buildSummary } from "common-utils";
/**
* Gather action inputs and then run action.
*/
async function run() {
const platform = process.platform;
const architecture = process.arch;
const workspaceDir = process.cwd();
const options: buildtool.RunBuildOptions = {
Tasks: core.getInput("tasks"),
BuildOptions: core.getInput("build-options"),
};
const command = buildtool.generateCommand(options);
const startupOptions = core.getInput("startup-options").split(" ");
const helperScript = await matlab.generateScript(workspaceDir, command);
const execOptions = {
env: {
...process.env,
MW_BATCH_LICENSING_ONLINE:'true', // Remove when online batch licensing is the default
"MW_MATLAB_BUILDTOOL_DEFAULT_PLUGINS_FCN_OVERRIDE": "buildframework.getDefaultPlugins",
}
};
await matlab.runCommand(
helperScript,
platform,
architecture,
(cmd, args) => exec.exec(cmd, args, execOptions),
startupOptions
).finally(() => {
const runnerTemp = process.env.RUNNER_TEMP || '';
const runId = process.env.GITHUB_RUN_ID || '';
const actionName = process.env.GITHUB_ACTION || '';
buildSummary.processAndAddBuildSummary(runnerTemp, runId, actionName);
testResultsSummary.processAndAddTestSummary(runnerTemp, runId, actionName, workspaceDir);
core.summary.write();
});
}
run().catch(e => {
core.setFailed(e);
});