From cfa23b04ad5a36e3719235878192e7530db04efa Mon Sep 17 00:00:00 2001 From: Johan Pereira <2079700+jwpereira@users.noreply.github.com> Date: Wed, 2 Dec 2020 18:27:52 -0500 Subject: [PATCH 1/4] Add swath of tests to workflow --- .github/workflows/bat.yml | 45 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bat.yml b/.github/workflows/bat.yml index 548c24c..f4bfb9c 100644 --- a/.github/workflows/bat.yml +++ b/.github/workflows/bat.yml @@ -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('SYSTEM_DEFAULTWORKINGDIRECTORY'); 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') From 572793d04c01fc461d2cd65f00fe3bac6d8b5af3 Mon Sep 17 00:00:00 2001 From: Johan Pereira <2079700+jwpereira@users.noreply.github.com> Date: Wed, 2 Dec 2020 18:44:56 -0500 Subject: [PATCH 2/4] Unsuppress output for working dir test --- .github/workflows/bat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bat.yml b/.github/workflows/bat.yml index f4bfb9c..8cf182d 100644 --- a/.github/workflows/bat.yml +++ b/.github/workflows/bat.yml @@ -56,7 +56,7 @@ jobs: - name: Run MATLAB statement in working directory uses: ./ with: - command: exp = getenv('SYSTEM_DEFAULTWORKINGDIRECTORY'); act = pwd; assert(strcmp(act, exp), strjoin({act exp}, '\n')); + command: exp = getenv('GITHUB_WORKSPACE'), act = pwd, assert(strcmp(act, exp), strjoin({act exp}, '\n')); - run: echo 'onetyone = 11' > startup.m shell: bash From 7b298ddd738fd1654706b3fd487ff08c23c6b0b7 Mon Sep 17 00:00:00 2001 From: Johan Pereira <2079700+jwpereira@users.noreply.github.com> Date: Wed, 2 Dec 2020 18:59:19 -0500 Subject: [PATCH 3/4] Unsuppress potentially useful output for integ tests --- .github/workflows/bat.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bat.yml b/.github/workflows/bat.yml index 8cf182d..6812885 100644 --- a/.github/workflows/bat.yml +++ b/.github/workflows/bat.yml @@ -36,22 +36,22 @@ jobs: - name: Run MATLAB statement with quotes 1 uses: ./ with: - command: "eval(\"a = 1+2\"); assert(a == 3); eval('b = 3+4'); assert(b == 7);" + 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);' + 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)); + 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); + command: a = " !""#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~", b = char([32:126]), assert(strcmp(a, b), a+b); - name: Run MATLAB statement in working directory uses: ./ From 1e72842c94a70ff313c015828fe3eac5bfa4b6c0 Mon Sep 17 00:00:00 2001 From: Johan Pereira <2079700+jwpereira@users.noreply.github.com> Date: Tue, 8 Dec 2020 10:23:09 -0500 Subject: [PATCH 4/4] 0.2.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2017da7..14664ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "run-matlab-command-action", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bb05f22..cafa92e 100644 --- a/package.json +++ b/package.json @@ -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": {