Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
45 changes: 44 additions & 1 deletion .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,50 @@ jobs:
env:
MATHWORKS_TOKEN: ${{ secrets.MATHWORKS_TOKEN }}

- name: Exercise RunMATLABCommand
- name: Greet the world in style
uses: ./
with:
command: "disp('hello world');"

- name: Run MATLAB statement
uses: ./
with:
command: f = fopen('myscript.m', 'w'); fwrite(f, 'assert(true)'); fclose(f);

- name: Run MATLAB script
uses: ./
with:
command: myscript

- name: Run MATLAB statement with quotes 1
uses: ./
with:
command: "eval(\"a = 1+2\"), assert(a == 3); eval('b = 3+4'), assert(b == 7);"

- name: Run MATLAB statement with quotes 2
uses: ./
with:
command: 'eval("a = 1+2"), assert(a == 3); eval(''b = 3+4''), assert(b == 7);'

- name: Run MATLAB statement with quotes 3
uses: ./
with:
command: a = """hello world""", b = '"hello world"', assert(strcmp(a,b));

- name: Run MATLAB statement with symbols
uses: ./
with:
command: a = " !""#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~", b = char([32:126]), assert(strcmp(a, b), a+b);

- name: Run MATLAB statement in working directory
uses: ./
with:
command: exp = getenv('GITHUB_WORKSPACE'), act = pwd, assert(strcmp(act, exp), strjoin({act exp}, '\n'));

- run: echo 'onetyone = 11' > startup.m
shell: bash

- name: MATLAB runs startup.m automatically
uses: ./
with:
command: assert(onetyone==11, 'the variable `onetyone` was not set as expected by startup.m')
2 changes: 1 addition & 1 deletion 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
@@ -1,7 +1,7 @@
{
"name": "run-matlab-command-action",
"author": "The MathWorks, Inc.",
"version": "0.2.0",
"version": "0.2.1",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand Down