File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 11name : Run MATLAB Tests
2-
32on :
43 push :
54 branches :
6- - main # Runs tests when code is pushed to main
5+ - main
76 pull_request :
87 branches :
9- - main # Runs tests when a PR is opened to main
10-
8+ - main
119jobs :
1210 run-matlab-tests :
1311 runs-on : ubuntu-latest
14-
1512 steps :
1613 - name : Checkout repository
17- uses : actions/checkout@v4 # Clones the repo
18-
14+ uses : actions/checkout@v4
1915 - name : Set up MATLAB
20- uses : matlab-actions/setup-matlab@v1 # Official MATLAB GitHub Action
21-
16+ uses : matlab-actions/setup-matlab@v1
2217 - name : Run MATLAB Test Script
2318 uses : matlab-actions/run-command@v1
2419 with :
2520 command : |
2621 try
22+ global testing_yml_workflow;
23+ testing_yml_workflow = true; % Indicate CI/CD mode
24+
25+ % Ensure serial execution
26+ if isempty(gcp('nocreate'))
27+ parpool('local', 1);
28+ end
29+
30+ % Run the test script
2731 power_calculator_test_script;
2832 disp('All tests passed successfully.');
2933 catch ME
3034 disp('Test failed.');
3135 disp(ME.message);
3236 exit(1);
3337 end
34-
You can’t perform that action at this time.
0 commit comments