1
1
name : Build and Test
2
2
on : [push]
3
+ permissions :
4
+ contents : read
3
5
4
6
jobs :
5
7
bat :
6
8
name : Build and Test
7
9
runs-on : ubuntu-latest
8
10
steps :
9
- - uses : actions/checkout@v4
10
- - uses : actions/setup-node@v4
11
+ - uses : actions/checkout@v5
12
+ - uses : actions/setup-node@v5
11
13
with :
12
14
node-version : 20
13
15
- name : Perform npm tasks
14
16
run : npm run ci
15
-
17
+ - uses : actions/upload-artifact@v4
18
+ with :
19
+ name : built-action
20
+ path : |
21
+ **/*
22
+ !node_modules/
23
+ integ :
24
+ needs : bat
25
+ runs-on : ${{ matrix.os }}
26
+ strategy :
27
+ fail-fast : false
28
+ matrix :
29
+ os : [ubuntu-latest, windows-latest, macos-latest, macos-14]
30
+ steps :
31
+ - uses : actions/download-artifact@v5
32
+ with :
33
+ name : built-action
16
34
- name : Perform 'setup-matlab'
17
35
uses : matlab-actions/setup-matlab@v2
18
-
19
36
- name : Greet the world in style
20
37
uses : ./
21
38
with :
22
39
command : " disp('hello world');"
23
-
24
40
- name : Run MATLAB statement
25
41
uses : ./
26
42
with :
27
43
command : f = fopen('myscript.m', 'w'); fwrite(f, 'assert(true)'); fclose(f);
28
-
29
44
- name : Run MATLAB script
30
45
uses : ./
31
46
with :
32
47
command : myscript
33
-
34
48
- name : Run MATLAB statement with quotes 1
35
49
uses : ./
36
50
with :
37
51
command : " eval(\" a = 1+2\" ), assert(a == 3); eval('b = 3+4'), assert(b == 7);"
38
-
39
52
- name : Run MATLAB statement with quotes 2
40
53
uses : ./
41
54
with :
42
55
command : ' eval("a = 1+2"), assert(a == 3); eval('' b = 3+4'' ), assert(b == 7);'
43
-
44
56
- name : Run MATLAB statement with quotes 3
45
57
uses : ./
46
58
with :
47
59
command : a = """hello world""", b = '"hello world"', assert(strcmp(a,b));
48
-
49
60
- name : Run MATLAB statement with symbols
50
61
uses : ./
51
62
with :
52
63
command : a = " !""#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~", b = char([32:126]), assert(strcmp(a, b), a+b);
53
-
54
64
- name : Run MATLAB statement in working directory
55
65
uses : ./
56
66
with :
57
67
command : exp = getenv('GITHUB_WORKSPACE'), act = pwd, assert(strcmp(act, exp), strjoin({act exp}, '\n'));
58
-
59
68
- name : Run MATLAB statement with arguments
60
69
uses : ./
61
70
with :
62
71
command : disp("Hello world!!")
63
72
startup-options : -nojvm -nodesktop -logfile mylog.log
64
-
65
73
- name : Validate that previous command ran with arguments
66
74
uses : ./
67
75
with :
68
76
command : assert(isfile("mylog.log"));
69
-
70
77
- run : echo 'onetyone = 11' > startup.m
71
78
shell : bash
72
-
73
79
- name : MATLAB runs startup.m automatically
74
80
uses : ./
75
81
with :
76
82
command : assert(onetyone==11, 'the variable `onetyone` was not set as expected by startup.m')
77
-
78
83
- run : |
79
84
mkdir subdir
80
85
echo 'onetyonetyone = 111' > subdir/startup.m
81
86
shell: bash
82
-
83
87
- name : MATLAB sd startup option is not overwritten
84
88
uses : ./
85
89
with :
@@ -88,17 +92,14 @@ jobs:
88
92
[~, f] = fileparts(pwd);
89
93
assert(strcmp(f, 'subdir'));
90
94
startup-options : -sd subdir
91
-
92
95
- name : Verify environment variables make it to MATLAB
93
96
uses : ./
94
97
with :
95
98
command : exp = 'my_value', act = getenv('MY_VAR'), assert(strcmp(act, exp), strjoin({act exp}, '\n'));
96
99
env :
97
100
MY_VAR : my_value
98
-
99
101
# Remove when online batch licensing is the default
100
102
- name : Verify MW_BATCH_LICENSING_ONLINE variable set
101
103
uses : ./
102
104
with :
103
105
command : exp = 'true', act = getenv('MW_BATCH_LICENSING_ONLINE'), assert(strcmp(act, exp), strjoin({act exp}, '\n'));
104
-
0 commit comments