Skip to content

Commit dfca60d

Browse files
committed
resolve merge conflicts
2 parents fe98514 + feffe6e commit dfca60d

File tree

9 files changed

+111
-44
lines changed

9 files changed

+111
-44
lines changed

.github/workflows/bat.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,34 @@ jobs:
6262
- name: Run run-test command
6363
uses: ./
6464
with:
65-
test-results-simulink-test: test-results/simulinktest.mldatx
66-
model-coverage-cobertura: test-results/modelcoverage.xml
67-
test-results-pdf: test-results/pdf-results.pdf
68-
select-by-folder: sample
69-
strict: true
70-
use-parallel: true
71-
output-detail: Detailed
72-
logging-level: Detailed
73-
continue-on-error: true
65+
test-results-simulink-test: test-results/simulinktest.mldatx
66+
model-coverage-cobertura: test-results/modelcoverage.xml
67+
test-results-pdf: test-results/pdf-results.pdf
68+
test-results-junit: test-results/results.xml
69+
code-coverage-cobertura: test-results/coverage.xml
70+
code-coverage-html: test-results/coverageHTML
71+
model-coverage-html: test-results/modelcoverageHTML
72+
test-results-html: test-results/resultsHTML
73+
select-by-folder: sample
74+
strict: true
75+
use-parallel: true
76+
output-detail: Detailed
77+
logging-level: Detailed
7478
- name: Verify artifacts generation
7579
run: |
76-
(test -f test-results/simulinktest.mldatx) || (echo "File simulinktest.mldatx does not exist" && exit 1)
77-
(test -f test-results/modelcoverage.xml) || (echo "File modelcoverage.xml does not exist" && exit 1)
78-
(test -f test-results/pdf-results.pdf) || (echo "File pdf-results.pdf does not exist" && exit 1)
79-
grep -q "runner.addPlugin(FailOnWarningsPlugin())" console.log
80-
grep -q "runInParallel" console.log
81-
grep -q "'OutputDetail', 3" console.log
82-
grep -q "'LoggingLevel', 3" console.log
80+
(test -f test-results/simulinktest.mldatx) || (echo "File simulinktest.mldatx does not exist" && exit 1)
81+
(test -f test-results/modelcoverage.xml) || (echo "File modelcoverage.xml does not exist" && exit 1)
82+
(test -f test-results/pdf-results.pdf) || (echo "File pdf-results.pdf does not exist" && exit 1)
83+
(test -f test-results/results.xml) || (echo "File results.xml does not exist" && exit 1)
84+
(test -f test-results/coverage.xml) || (echo "File coverage.xml does not exist" && exit 1)
85+
(test -d test-results/coverageHTML) || (echo "Directory coverageHTML does not exist" && exit 1)
86+
(test -f test-results/coverageHTML/*.html) || (echo "No HTML file found" && exit 1)
87+
(test -d test-results/modelcoverageHTML) || (echo "Directory modelcoverageHTML does not exist" && exit 1)
88+
(test -f test-results/modelcoverageHTML/*.html) || (echo "No HTML file found" && exit 1)
89+
(test -d test-results/resultsHTML) || (echo "Directory resultsHTML does not exist" && exit 1)
90+
(test -f test-results/resultsHTML/*.html) || (echo "No HTML file found" && exit 1)
91+
grep -q "runner.addPlugin(FailOnWarningsPlugin())" console.log
92+
grep -q "runInParallel" console.log
93+
grep -q "'OutputDetail', 3" console.log
94+
grep -q "'LoggingLevel', 3" console.log
8395
shell: bash

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The [Run MATLAB Tests](#run-matlab-tests) action enables you to run MATLAB®
44
- To use a self-hosted runner, set up a computer with MATLAB on its path and register the runner with GitHub Actions. (On self-hosted UNIX® runners, you can also use the **Setup MATLAB** action instead of having MATLAB already installed.) The runner uses the topmost MATLAB release on the system path to execute your workflow.
55

66
## Examples
7-
Use the **Run MATLAB Tests** action to automatically run tests authored using the MATLAB unit testing framework or Simulink Test™. You can use this action with optional inputs to generate various test and coverage artifacts.
7+
Use the **Run MATLAB Tests** action to automatically run tests authored using the MATLAB unit testing framework or Simulink Test™. To use the action, you need MATLAB R2013b or a later release. Some of the optional action inputs require newer MATLAB releases or additional toolboxes.
88

99
### Run Tests in MATLAB Project
1010
On a self-hosted runner that has MATLAB installed, run the tests in your [MATLAB project](https://www.mathworks.com/help/matlab/projects.html). To run the tests, specify the **Run MATLAB Tests** action in your workflow.
@@ -115,12 +115,15 @@ Input | Description
115115
`use-parallel` | <p>(Optional) Option to run tests in parallel, specified as `false` or `true`. By default, the value is `false` and tests run in serial. If the test runner configuration is suited for parallelization, you can specify a value of `true` to run tests in parallel. This input requires a Parallel Computing Toolbox license.</p><p>**Example:** `use-parallel: true`</p>
116116
`output-detail` | <p>(Optional) Amount of event detail displayed for the test run, specified as `none`, `terse`, `concise`, `detailed`, or `verbose`. By default, the action displays failing and logged events at the `detailed` level and test run progress at the `concise` level.<p></p>**Example:** `output-detail: verbose`</p>
117117
`logging-level` | <p>(Optional) Maximum verbosity level for logged diagnostics included for the test run, specified as `none`, `terse`, `concise`, `detailed`, or `verbose`. By default, the action includes diagnostics logged at the `terse` level.<p></p>**Example:** `logging-level: detailed`</p>
118-
`test-results-pdf` | <p>(Optional) Location to write the test results in PDF format, specified as a path relative to the project root folder. On macOS platforms, this input is supported in MATLAB R2020b and later.</p><p>**Example:** `test-results-pdf: test-results/results.pdf`</p>
119-
`test-results-junit` | <p>(Optional) Location to write the test results in JUnit-style XML format, specified as a path relative to the project root folder.</p><p>**Example:** `test-results-junit: test-results/results.xml`</p>
120-
`test-results-simulink-test` | <p>(Optional) Location to export Simulink Test Manager results in MLDATX format, specified as a path relative to the project root folder. This input requires a Simulink Test license and is supported in MATLAB R2019a and later.</p><p>**Example:** `test-results-simulink-test: test-results/results.mldatx`</p>
121-
`code-coverage-cobertura` | <p>(Optional) Location to write the code coverage results in Cobertura XML format, specified as a path relative to the project root folder.</p><p>**Example:** `code-coverage-cobertura: code-coverage/coverage.xml`</p>
122-
`model-coverage-cobertura` | <p>(Optional) Location to write the model coverage results in Cobertura XML format, specified as a path relative to the project root folder. This input requires a Simulink Coverage™ license and is supported in MATLAB R2018b and later.</p><p>**Example:** `model-coverage-cobertura: model-coverage/coverage.xml`</p>
123-
`startup-options` | <p>(Optional) MATLAB startup options, specified as a list of options separated by spaces. For more information about startup options, see [Commonly Used Startup Options](https://www.mathworks.com/help/matlab/matlab_env/commonly-used-startup-options.html).</p><p>Using this input to specify the `-batch` or `-r` option is not supported.</p><p>**Example:** `startup-options: -nojvm`<br/>**Example:** `startup-options: -nojvm -logfile output.log`</p>
118+
`test-results-html` | <p>(Optional) Location to write the test results in HTML format, specified as a folder path relative to the project root folder.</p><p>**Example:** `test-results-html: test-results`</p>
119+
`test-results-pdf` | <p>(Optional) Location to write the test results in PDF format, specified as a file path relative to the project root folder. On macOS platforms, this input is supported in MATLAB R2020b and later.</p><p>**Example:** `test-results-pdf: test-results/results.pdf`</p>
120+
`test-results-junit` | <p>(Optional) Location to write the test results in JUnit-style XML format, specified as a file path relative to the project root folder.</p><p>**Example:** `test-results-junit: test-results/results.xml`</p>
121+
`test-results-simulink-test` | <p>(Optional) Location to export Simulink Test Manager results in MLDATX format, specified as a file path relative to the project root folder. This input requires a Simulink Test license and is supported in MATLAB R2019a and later.</p><p>**Example:** `test-results-simulink-test: test-results/results.mldatx`</p>
122+
`code-coverage-html` | <p>(Optional) Location to write the code coverage results in HTML format, specified as a folder path relative to the project root folder.</p><p>**Example:** `code-coverage-html: code-coverage`</p>
123+
`code-coverage-cobertura` | <p>(Optional) Location to write the code coverage results in Cobertura XML format, specified as a file path relative to the project root folder.</p><p>**Example:** `code-coverage-cobertura: code-coverage/coverage.xml`</p>
124+
`model-coverage-html` | <p>(Optional) Location to write the model coverage results in HTML format, specified as a folder path relative to the project root folder. This input requires a Simulink Coverage&trade; license and is supported in MATLAB R2018b and later.</p><p>**Example:** `model-coverage-html: model-coverage`</p>
125+
`model-coverage-cobertura` | <p>(Optional) Location to write the model coverage results in Cobertura XML format, specified as a file path relative to the project root folder. This input requires a Simulink Coverage license and is supported in MATLAB R2018b and later.</p><p>**Example:** `model-coverage-cobertura: model-coverage/coverage.xml`</p>
126+
`startup-options` | <p>(Optional) MATLAB startup options, specified as a list of options separated by spaces. For more information about startup options, see [Commonly Used Startup Options](https://www.mathworks.com/help/matlab/matlab_env/commonly-used-startup-options.html).</p><p>Using this input to specify the `-batch` or `-r` option is not supported.</p><p>**Example:** `startup-options: -nojvm`<br/>**Example:** `startup-options: -nojvm -logfile output.log`</p>
124127

125128
## Notes
126129
* By default, when you use the **Run MATLAB Tests** action, the root of your repository serves as the MATLAB startup folder. To run your tests using a different folder, specify the `-sd` startup option in the action.

action.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,42 @@ inputs:
4141
default: ""
4242
test-results-pdf:
4343
description: >-
44-
Path to write test results report in PDF format
44+
File path to write test results in PDF format
45+
required: false
46+
default: ""
47+
test-results-html:
48+
description: >-
49+
Folder path to write test results in HTML format
4550
required: false
4651
default: ""
4752
test-results-junit:
4853
description: >-
49-
Path to write test results report in JUnit XML format
54+
File path to write test results in JUnit-style XML format
5055
required: false
5156
default: ""
5257
test-results-simulink-test:
5358
description: >-
54-
Path to export Simulink Test Manager results in MLDATX format
59+
File path to export Simulink Test Manager results in MLDATX format
5560
required: false
5661
default: ""
5762
code-coverage-cobertura:
5863
description: >-
59-
Path to write code coverage report in Cobertura XML format
64+
File path to write code coverage results in Cobertura XML format
65+
required: false
66+
default: ""
67+
code-coverage-html:
68+
description: >-
69+
Folder path to write code coverage results in HTML format
6070
required: false
6171
default: ""
6272
model-coverage-cobertura:
6373
description: >-
64-
Path to write model coverage report in Cobertura XML format
74+
File path to write model coverage results in Cobertura XML format
75+
required: false
76+
default: ""
77+
model-coverage-html:
78+
description: >-
79+
Folder path to write model coverage results in HTML format
6580
required: false
6681
default: ""
6782
startup-options:

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "run-matlab-tests-action",
33
"author": "The MathWorks, Inc.",
4-
"version": "2.1.2",
4+
"version": "2.2.0",
55
"description": "",
66
"main": "lib/index.js",
77
"scripts": {
@@ -21,8 +21,8 @@
2121
"dependencies": {
2222
"@actions/core": "^1.11.1",
2323
"@actions/exec": "^1.1.1",
24-
"run-matlab-command-action": "github:matlab-actions/run-command#v2.2.1",
25-
"common-utils": "github:matlab-actions/common-utils#kapilg/refactor"
24+
"common-utils": "github:matlab-actions/common-utils#kapilg/refactor",
25+
"run-matlab-command-action": "github:matlab-actions/run-command#v2.3.0"
2626
},
2727
"devDependencies": {
2828
"@types/jest": "^30.0.0",

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { testResultsSummary } from "common-utils";
88
import * as path from "path";
99

1010
/**
11-
* Gather action inputs and then run action.
11+
* Gather action inputs and then run action
1212
*/
1313
async function run() {
1414
const platform = process.platform;
@@ -18,10 +18,13 @@ async function run() {
1818
const options: scriptgen.RunTestsOptions = {
1919
JUnitTestResults: core.getInput("test-results-junit"),
2020
CoberturaCodeCoverage: core.getInput("code-coverage-cobertura"),
21+
HTMLCodeCoverage: core.getInput("code-coverage-html"),
2122
SourceFolder: core.getInput("source-folder"),
2223
PDFTestReport: core.getInput("test-results-pdf"),
24+
HTMLTestReport: core.getInput("test-results-html"),
2325
SimulinkTestResults: core.getInput("test-results-simulink-test"),
2426
CoberturaModelCoverage: core.getInput("model-coverage-cobertura"),
27+
HTMLModelCoverage: core.getInput("model-coverage-html"),
2528
SelectByTag: core.getInput("select-by-tag"),
2629
SelectByFolder: core.getInput("select-by-folder"),
2730
Strict: core.getBooleanInput("strict"),

src/scriptgen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ import * as path from "path";
99
export interface RunTestsOptions {
1010
JUnitTestResults?: string;
1111
CoberturaCodeCoverage?: string;
12+
HTMLCodeCoverage?: string;
1213
SourceFolder?: string;
1314
PDFTestReport?: string;
15+
HTMLTestReport?: string;
1416
SimulinkTestResults?: string;
1517
CoberturaModelCoverage?: string;
18+
HTMLModelCoverage?: string;
1619
SelectByTag?: string;
1720
SelectByFolder?: string;
1821
Strict?: boolean;
@@ -32,10 +35,13 @@ export function generateCommand(options: RunTestsOptions): string {
3235
testScript = genscript('Test',
3336
'JUnitTestResults','${options.JUnitTestResults || ""}',
3437
'CoberturaCodeCoverage','${options.CoberturaCodeCoverage || ""}',
38+
'HTMLCodeCoverage','${options.HTMLCodeCoverage || ""}',
3539
'SourceFolder','${options.SourceFolder || ""}',
3640
'PDFTestReport','${options.PDFTestReport || ""}',
41+
'HTMLTestReport','${options.HTMLTestReport || ""}',
3742
'SimulinkTestResults','${options.SimulinkTestResults || ""}',
3843
'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',
44+
'HTMLModelCoverage','${options.HTMLModelCoverage || ""}',
3945
'SelectByTag','${options.SelectByTag || ""}',
4046
'SelectByFolder','${options.SelectByFolder || ""}',
4147
'Strict',${options.Strict || false},

0 commit comments

Comments
 (0)