Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
8 changes: 8 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ jobs:
[~, f] = fileparts(pwd);
assert(strcmp(f, 'subdir'));
startup-options: -sd subdir
- name: Run command to run tests
uses: ./
with:
command: runtests("sample/TheTruth.m");
- name: Run command to run tests (sanity check for test summary)
uses: ./
with:
command: runtests("sample/TheTruth.m"); runtests("sample/TheTruth.m"); runtests("sample/TheTruth.m");
- name: Create buildfile.m in project root for build and test summary
shell: bash
run: |
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ inputs:
Startup options for MATLAB
required: false
default: ""
generate-summary:
description: >-
Option to generate a summary for the GitHub job summary
required: false
default: true
runs:
using: node24
main: dist/index.js
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"common-utils": "github:matlab-actions/common-utils#v2.2.2"
"common-utils": "github:matlab-actions/common-utils#v2.3.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
Expand Down
20 changes: 15 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ async function run() {

const command = core.getInput("command");
const startupOpts = core.getInput("startup-options").split(" ");
const generateSummary = core.getBooleanInput("generate-summary");

const helperScript = await matlab.generateScript(workspaceDir, command);
const execOpts = {
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",
MW_GENERATE_SUMMARY: String(generateSummary),
Comment thread
mw-kapilg marked this conversation as resolved.
Outdated
},
};
await matlab
Expand All @@ -32,12 +34,20 @@ async function run() {
startupOpts,
)
.finally(() => {
const runnerTemp = process.env.RUNNER_TEMP || "";
const runId = process.env.GITHUB_RUN_ID || "";
if (generateSummary) {
const runnerTemp = process.env.RUNNER_TEMP || "";
const runId = process.env.GITHUB_RUN_ID || "";
const actionName = process.env.GITHUB_ACTION || "";

buildSummary.processAndAddBuildSummary(runnerTemp, runId);
testResultsSummary.processAndAddTestSummary(runnerTemp, runId, workspaceDir);
core.summary.write();
buildSummary.processAndAddBuildSummary(runnerTemp, actionName);
testResultsSummary.processAndAddTestSummary(
runnerTemp,
runId,
actionName,
workspaceDir,
);
core.summary.write();
}
});
}

Expand Down
Loading