Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c65784c
Add test results data viz
mw-kapilg Jul 26, 2025
b1b3d32
update imports
mw-kapilg Jul 26, 2025
5494434
print total tests count
mw-kapilg Jul 26, 2025
824d0ea
update yml
mw-kapilg Jul 26, 2025
0c02d1e
check workspace
mw-kapilg Jul 26, 2025
3edc95d
fix join
mw-kapilg Jul 26, 2025
57c89c2
update pluginPath
mw-kapilg Jul 26, 2025
a8a74e2
move resources
mw-kapilg Jul 26, 2025
cd76bb4
add copy dir command
mw-kapilg Jul 28, 2025
60641a0
remove test file
mw-kapilg Jul 28, 2025
cea78e6
rename resource
mw-kapilg Jul 28, 2025
49e97fc
update namespace
mw-kapilg Jul 28, 2025
1f7e10f
update counts to stats
mw-kapilg Jul 29, 2025
fab87bb
fix error
mw-kapilg Jul 29, 2025
1f15178
move failed tests section above all tests
mw-kapilg Jul 29, 2025
1ae1bfc
introduce test failure
mw-kapilg Jul 29, 2025
4ba0f44
update failed tests view
mw-kapilg Jul 29, 2025
82f871c
add title and preserve MATLAB formatting
mw-kapilg Jul 29, 2025
a413836
add more tests and update view
mw-kapilg Jul 29, 2025
5b575c2
try nested table
mw-kapilg Jul 29, 2025
d6d9106
unify sections
mw-kapilg Jul 29, 2025
8bf52cc
format diagnostics
mw-kapilg Jul 29, 2025
a785b2a
format table
mw-kapilg Jul 29, 2025
c6ebf80
format function calls
mw-kapilg Jul 29, 2025
6bebf1d
update testcase
mw-kapilg Jul 29, 2025
e389346
more formattinhg
mw-kapilg Jul 29, 2025
fc3675b
update join separator
mw-kapilg Jul 29, 2025
db06047
update all join separators
mw-kapilg Jul 29, 2025
0738bc4
add sub-heading
mw-kapilg Jul 29, 2025
f24d519
introduce test failure
mw-kapilg Jul 29, 2025
bdb3d50
remove diagnostics formatting
mw-kapilg Jul 29, 2025
19fcb17
add formatting for double \n
mw-kapilg Jul 30, 2025
e15aa46
add whitespace
mw-kapilg Jul 30, 2025
e402790
debug
mw-kapilg Jul 30, 2025
e14c1e8
debug
mw-kapilg Jul 30, 2025
821cb5e
debug
mw-kapilg Jul 30, 2025
cfc99c9
debug
mw-kapilg Jul 30, 2025
ae65450
double \n formatting
mw-kapilg Jul 30, 2025
34242c0
debug
mw-kapilg Jul 30, 2025
9b81017
debug
mw-kapilg Jul 30, 2025
9c9c939
debug
mw-kapilg Jul 30, 2025
252ead3
debug
mw-kapilg Jul 30, 2025
f7804a6
debug
mw-kapilg Jul 30, 2025
126f970
debug
mw-kapilg Jul 30, 2025
b2da600
debug
mw-kapilg Jul 30, 2025
a5d8879
debug
mw-kapilg Jul 30, 2025
fa99631
debug
mw-kapilg Jul 30, 2025
3015c86
update diagnostics condition
mw-kapilg Jul 31, 2025
dd37154
update file path
mw-kapilg Aug 7, 2025
f68026d
update display path
mw-kapilg Aug 7, 2025
1e4bd63
add action name
mw-kapilg Aug 7, 2025
56aaf64
update workspace
mw-kapilg Aug 7, 2025
3068d2e
refactor
mw-kapilg Aug 7, 2025
c7abd6b
verify multiple test runs in same action
mw-kapilg Aug 7, 2025
9efca69
add grouping
mw-kapilg Aug 12, 2025
712cd93
add test class grouping
mw-kapilg Aug 12, 2025
20d8caf
update test class grouping
mw-kapilg Aug 12, 2025
7735ea7
update test class grouping
mw-kapilg Aug 12, 2025
2682c53
remove test case grouping
mw-kapilg Aug 12, 2025
b39d2c9
remove old grouping
mw-kapilg Aug 12, 2025
a2bde78
add tests
mw-kapilg Sep 4, 2025
0781a4e
add multi-platform testting
mw-kapilg Sep 4, 2025
0030d91
debug
mw-kapilg Sep 4, 2025
a74e69d
update test setup
mw-kapilg Sep 4, 2025
6edaa6e
remove extra files and add more MATLAB tests
mw-kapilg Sep 4, 2025
01cee5f
update os check
mw-kapilg Sep 4, 2025
a40dfd1
add continue-on-error
mw-kapilg Sep 4, 2025
b4a9df5
update assumption failure
mw-kapilg Sep 4, 2025
f7f6a8c
format code and add more tests
mw-kapilg Sep 4, 2025
f7f0650
update os info
mw-kapilg Sep 4, 2025
697994b
fix merge conflict
mw-kapilg Sep 4, 2025
58550a6
update package
mw-kapilg Sep 4, 2025
7c10b22
move fatalAssertion failure to a new file so it runs at the end
mw-kapilg Sep 5, 2025
0d63cbd
fix codescan issue and add help icon
mw-kapilg Sep 5, 2025
e5e8998
fix test
mw-kapilg Sep 5, 2025
bcd0513
fix typo
mw-kapilg Sep 5, 2025
7e4c242
remove fatal assertion as it cause other test scripts to not run
mw-kapilg Sep 5, 2025
5947a9e
update genscript url temporarily for dev
mw-kapilg Sep 5, 2025
fe98514
move test summary and log grouping to common-utils
mw-kapilg Oct 29, 2025
dfca60d
resolve merge conflicts
mw-kapilg Oct 29, 2025
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: 4 additions & 2 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
uses: matlab-actions/setup-matlab@v2
with:
products: |
MATLAB_Test
Simulink
Simulink_Test
Simulink_Coverage
Expand All @@ -44,6 +45,7 @@ jobs:
with:
source-folder: sample
startup-options: -logfile output.log
continue-on-error: true
- name: Verify option application
run: |
set -e
Expand All @@ -54,7 +56,7 @@ jobs:
- name: Generate Model
uses: matlab-actions/run-command@v2
with:
command: cd('sample'),createSampleModel('temp_model'),sltest.testmanager.createTestsFromModel('sltestfile', 'temp_model');
command: cd('sample'),createSampleModel('temp_model'),sltest.testmanager.createTestsFromModel('sltestfile', 'temp_model');
- name: Set up diary for logging
run: echo 'diary console.log' >> startup.m
- name: Run run-test command
Expand Down Expand Up @@ -90,4 +92,4 @@ jobs:
grep -q "runInParallel" console.log
grep -q "'OutputDetail', 3" console.log
grep -q "'LoggingLevel', 3" console.log
shell: bash
shell: bash
2,024 changes: 747 additions & 1,277 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"common-utils": "github:matlab-actions/common-utils#kapilg/refactor",
"run-matlab-command-action": "github:matlab-actions/run-command#v2.3.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/jsdom": "^21.1.7",
"@types/node": "^24.3.0",
"@vercel/ncc": "^0.38.3",
"jest": "^30.0.5",
"jest-circus": "^30.0.5",
"jsdom": "^26.1.0",
"prettier": "3.6.2",
"ts-jest": "^29.4.1",
"typescript": "^5.9.2"
Expand Down
7 changes: 7 additions & 0 deletions sample/tAssumptionFailure.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
classdef tAssumptionFailure < matlab.unittest.TestCase
methods (Test)
function testAssumptionFailure(testCase)
testCase.assumeEqual(1+1, 11);
end
end
end
15 changes: 15 additions & 0 deletions sample/tVerificationAndAssertionFailure.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
classdef tVerificationAndAssertionFailure < matlab.unittest.TestCase
methods (Test)
function testVerificationFailure(testCase)
% Two verifications to show that the test continues after a verification failure
testCase.verifyEqual(1+1, 11);
testCase.verifyEqual(1+1, 11);
end

function testAssertionFailure(testCase)
% Two assertions to show that the test ends after an assertion failure
testCase.assertEqual(1+1, 11);
testCase.assertEqual(1+1, 11);
end
end
end
27 changes: 2 additions & 25 deletions scripts/setupdeps.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
#!/bin/bash

SCRIPTGEN_URL='https://ssd.mathworks.com/supportfiles/ci/matlab-script-generator/v0/matlab-script-generator.zip'
RMC_BASE_URL='https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2'
SUPPORTED_OS=('win64' 'maci64' 'maca64' 'glnxa64')

# Create dist directory if it doesn't already exist
DISTDIR="$(pwd)/dist"
mkdir -p $DISTDIR/bin

# Download and extract in a temporary directory
WORKINGDIR=$(mktemp -d -t rmc_build.XXXXXX)
cd $WORKINGDIR
source ./node_modules/common-utils/scripts/setupdeps.sh

wget -O "$WORKINGDIR/license.txt" "$RMC_BASE_URL/license.txt"
wget -O "$WORKINGDIR/thirdpartylicenses.txt" "$RMC_BASE_URL/thirdpartylicenses.txt"

for os in ${SUPPORTED_OS[@]}
do
if [[ $os == 'win64' ]] ; then
bin_ext='.exe'
else
bin_ext=''
fi
mkdir -p "$WORKINGDIR/$os"
wget -O "$WORKINGDIR/$os/run-matlab-command$bin_ext" "$RMC_BASE_URL/$os/run-matlab-command$bin_ext"
done
SCRIPTGEN_URL='https://ssd.mathworks.com/supportfiles/ci/matlab-script-generator/v0/matlab-script-generator.zip'

wget -O scriptgen.zip $SCRIPTGEN_URL
unzip -qod scriptgen scriptgen.zip
Expand All @@ -33,4 +11,3 @@ rm scriptgen.zip

mv -f ./* "$DISTDIR/bin"
rm -rf $WORKINGDIR

19 changes: 10 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright 2020-2023 The MathWorks, Inc.
// Copyright 2020-2025 The MathWorks, Inc.

import * as core from "@actions/core";
import * as exec from "@actions/exec";
import { matlab } from "run-matlab-command-action";
import * as scriptgen from "./scriptgen";
import { testResultsSummary } from "common-utils";
import * as path from "path";

/**
* Gather action inputs and then run action
Expand Down Expand Up @@ -31,17 +33,16 @@ async function run() {
LoggingLevel: core.getInput("logging-level"),
};

const command = scriptgen.generateCommand(options);
const pluginsPath = path.join(__dirname, "plugins").replaceAll("'","''");
const command = "addpath('"+ pluginsPath +"'); " + scriptgen.generateCommand(options);
const startupOptions = core.getInput("startup-options").split(" ");

const helperScript = await core.group("Generate script", async () => {
const helperScript = await matlab.generateScript(workspaceDir, command);
core.info("Successfully generated script");
return helperScript;
});
const helperScript = await matlab.generateScript(workspaceDir, command);
core.info("Successfully generated test script!");

await core.group("Run command", async () => {
await matlab.runCommand(helperScript, platform, architecture, exec.exec, startupOptions);
await matlab.runCommand(helperScript, platform, architecture, exec.exec, startupOptions).finally(() => {
const testResultsData = testResultsSummary.getTestResults(process.env.RUNNER_TEMP || '', process.env.GITHUB_RUN_ID || '', workspaceDir);
testResultsSummary.writeSummary(testResultsData, process.env.GITHUB_ACTION || '');
});
}

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES6",
"target": "ES2022",
"module": "CommonJS",
"declaration": true,
"sourceMap": true,
Expand Down
Loading