Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
6 changes: 6 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ jobs:
Simulink
Simulink_Test
Simulink_Coverage
- name: Run MATLAB Tests with job summary disabled
continue-on-error: true
Comment thread
mw-kapilg marked this conversation as resolved.
Outdated
uses: ./
with:
source-folder: sample
generate-summary: false
Comment thread
mw-kapilg marked this conversation as resolved.
- name: Run MATLAB Tests
continue-on-error: true
uses: ./
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## For development environment
.vscode

# Claude
.claude/

# Don't include intermediate TypeScript compilation;
# it should be forcibly added on release
lib
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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
code-coverage-metric-level:
description: >-
Level of coverage metrics to collect
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
hasCoverageRequest = hasCoverageHTML || hasCoverageCobertura;

% Check if MATLAB Test license is available and MATLAB Test is installed
if license('test', 'matlab_test') && isProductInstalled && ~hasCoverageRequest
if strcmpi(getenv("MW_GENERATE_SUMMARY"), "true") && ~hasCoverageRequest && license('test', 'matlab_test') && isProductInstalled
% Get metric level from environment variable
metricLevel = getenv('INPUT_CODE_COVERAGE_METRIC_LEVEL');

Expand Down
19 changes: 14 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function run() {
LoggingLevel: core.getInput("logging-level"),
};

const generateSummary = core.getBooleanInput("generate-summary");
var codeCoverageMetricLevel = core.getInput("code-coverage-metric-level").toLowerCase();

// Validate metric level
Expand All @@ -54,6 +55,7 @@ async function run() {
INPUT_SOURCE_FOLDER: options.SourceFolder!, // Add source folder to environment
INPUT_CODE_COVERAGE_HTML: options.HTMLCodeCoverage!,
INPUT_CODE_COVERAGE_COBERTURA: options.CoberturaCodeCoverage!,
MW_GENERATE_SUMMARY: String(generateSummary),
Comment thread
mw-kapilg marked this conversation as resolved.
Outdated
},
};
core.info("Successfully generated test script!");
Expand All @@ -67,12 +69,19 @@ async function run() {
startupOptions,
)
.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 || "";

//add test results and code coverage view
testResultsSummary.processAndAddTestSummary(runnerTemp, runId, workspaceDir);
core.summary.write();
testResultsSummary.processAndAddTestSummary(
runnerTemp,
runId,
actionName,
workspaceDir,
);
core.summary.write();
}
});
}

Expand Down
Loading