Skip to content

Commit 438ff4b

Browse files
committed
Maintenance for R2025b
* Update to new startup app * Improve ci.yml * Standardize project details * Remove reference to emailing for solutions in README as the solutions are included in Instructor Resources * Update identity as the MathWorks Educator Content Development team
1 parent f41ddbd commit 438ff4b

133 files changed

Lines changed: 681 additions & 315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
MATLABVersion: [R2024a,R2024b]
22+
MATLABVersion: [R2024b,R2025a,R2025b]
2323
runs-on: ubuntu-latest
24+
env:
25+
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
2426
steps:
2527
# Checks-out your repository
2628
- uses: actions/checkout@v4

.gitlab-ci.yml

Lines changed: 79 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,83 +5,91 @@ stages:
55
- deploy
66
- release
77

8-
setup-job:
9-
tags:
10-
- matlab
11-
stage: setup
12-
script:
13-
- cd ..
14-
- if (test-path utilities) { rm -r -force utilities }
15-
- git clone git@insidelabs-git.mathworks.com:modular-curriculum-content/utilities.git
16-
- cd $CI_PROJECT_NAME
17-
allow_failure: false
8+
.setup_matlab_windows: &setup_matlab_windows
9+
- $env:MLM_LICENSE_TOKEN="$LICENSEOWNER|$LICENSELABEL|$LICENSETOKEN" # Set the batch token license
10+
- Set-Alias -Name matlab -Value "D:\MATLAB\$VERSION\bin\matlab-batch"
1811

12+
setup-job:
13+
tags:
14+
- training
15+
- windows
16+
stage: setup
17+
script:
18+
- cd ..
19+
- if (test-path utilities) { rm -r -force utilities }
20+
- git clone https://insidelabs-git.mathworks.com/modular-curriculum-content/utilities.git
21+
- cd $CI_PROJECT_NAME
22+
allow_failure: false
1923

2024
smoke-test:
21-
# Smoke tests should run all the time
22-
tags:
23-
# Add additional tags like (e.g. - arduino) as required
24-
# Make sure that the runner you plan to use matches the tags
25-
- matlab
26-
stage: test
27-
parallel:
28-
matrix:
29-
- VERSION: [R2024a,R2024b]
30-
script:
31-
- Set-Alias -Name matlab -Value "C:\Program Files\MATLAB\$VERSION\bin\matlab.exe"
32-
- matlab -batch "openProject(pwd);RunAllTests"
33-
when: always
34-
allow_failure: true
35-
artifacts:
36-
name: "$VERSION"
37-
paths:
38-
- public/*
39-
when: always
40-
25+
parallel:
26+
matrix:
27+
- VERSION: [R2024b,R2025a,R2025b]
28+
tags:
29+
- training
30+
- windows
31+
stage: test
32+
script:
33+
- *setup_matlab_windows
34+
- matlab "openProject(pwd);RunAllTests"
35+
when: always
36+
allow_failure: true
37+
artifacts:
38+
name: "$VERSION"
39+
paths:
40+
- public/*
41+
when: always
4142

4243
pages:
43-
tags:
44-
- matlab
45-
stage: deploy
46-
script:
47-
- matlab -batch "openProject(pwd);PostSmokeTest;"
48-
artifacts:
49-
paths:
50-
- public
44+
variables:
45+
VERSION: "R2025a"
46+
tags:
47+
- training
48+
- windows
49+
stage: deploy
50+
script:
51+
- *setup_matlab_windows
52+
- matlab "openProject(pwd);PostSmokeTest;"
53+
artifacts:
54+
paths:
55+
- public
5156

5257
file-test:
53-
tags:
54-
- matlab
55-
stage: release
56-
script:
57-
- matlab -batch "proj = openProject(pwd);
58-
addpath(proj.RootFolder+'/InternalFiles/Tests/CI');
59-
results = runtests('OpenCloseFileTest.m');
60-
disp(table(results)); assertSuccess(results);"
61-
rules:
62-
# This test should always run when merging to main
63-
# And be available for manual running on any push
64-
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
65-
when: always
66-
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
67-
when: manual
68-
allow_failure: true
58+
variables:
59+
VERSION: "R2025a"
60+
tags:
61+
- training
62+
- windows
63+
stage: release
64+
script:
65+
- *setup_matlab_windows
66+
- matlab "proj = openProject(pwd);
67+
addpath(proj.RootFolder+'/InternalFiles/Tests/CI');
68+
results = runtests('OpenCloseFileTest.m');
69+
disp(table(results)); assertSuccess(results);"
70+
rules:
71+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
72+
when: always
73+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
74+
when: manual
75+
allow_failure: true
6976

7077
release-testing:
71-
tags:
72-
- matlab
73-
stage: release
74-
script:
75-
- matlab -batch "proj = openProject(pwd);
76-
cd ..;
77-
addpath(genpath(fullfile('utilities','TestingResources')));
78-
addpath(genpath(fullfile('utilities','Tools')));
79-
runCMTests"
80-
rules:
81-
# This test should always run when merging to main
82-
# And be available for manual running on any push
83-
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
84-
when: always
85-
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
86-
when: manual
87-
allow_failure: true
78+
variables:
79+
VERSION: "R2025a"
80+
tags:
81+
- training
82+
- windows
83+
stage: release
84+
script:
85+
- matlab "proj = openProject(pwd);
86+
cd ..;
87+
addpath(genpath(fullfile('utilities','TestingResources')));
88+
addpath(genpath(fullfile('utilities','Tools')));
89+
runCMTests"
90+
rules:
91+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
92+
when: always
93+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
94+
when: manual
95+
allow_failure: true

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The instructions inside the live scripts will guide you through the exercises an
2424

2525
## Contact Us
2626

27-
Contact the [MathWorks teaching resources team](mailto:onlineteaching@mathworks.com) if you would like to provide feedback, or if you have a question.
27+
Contact the [MathWorks Educator Content Development Team](mailto:onlineteaching@mathworks.com) if you would like to provide feedback, or if you have a question.
2828

2929

3030
## Prerequisites
@@ -85,9 +85,9 @@ Or feel free to explore our other [modular courseware content](https://www.mathw
8585

8686
# Contribute
8787

88-
Looking for more? Find an issue? Have a suggestion? Please contact the [MathWorks teaching resources team](mailto:%20onlineteaching@mathworks.com). If you want to contribute directly to this project, you can find information about how to do so in the [CONTRIBUTING.md](https://github.com/MathWorks-Teaching-Resources/Mass-Spring-Damper-Systems/blob/release/CONTRIBUTING.md) page on GitHub.
88+
Looking for more? Find an issue? Have a suggestion? Please contact the [MathWorks Educator Content Development Team](mailto:%20onlineteaching@mathworks.com). If you want to contribute directly to this project, you can find information about how to do so in the [CONTRIBUTING.md](https://github.com/MathWorks-Teaching-Resources/Mass-Spring-Damper-Systems/blob/release/CONTRIBUTING.md) page on GitHub.
8989

9090

91-
*©* Copyright 2023 The MathWorks™, Inc
91+
*©* Copyright 2025 The MathWorks™, Inc
9292

9393

README.mlx

-1 Bytes
Binary file not shown.

SoftwareTests/PostSmokeTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function PostSmokeTest(ShowReport)
3232
% Format the results in a table and save them
3333
Results = table(Results');
3434
Version = extractBetween(string(Results.Name),"Version=",")");
35-
Passed = Results.Passed;
35+
Passed = logical(Results.Passed);
3636

3737
% Add link to other report
3838
File = fileread(fullfile("public","index.html"));
@@ -51,7 +51,7 @@ function PostSmokeTest(ShowReport)
5151
Badge.message = join("R"+Version," | ");
5252
elseif any(Passed)
5353
Badge.color = "yellowgreen";
54-
Badge.message = join("R")
54+
Badge.message = join("R"+Version(Passed)," | ");
5555
elseif all(~Passed)
5656
Badge.color = "critical";
5757
Badge.message = join("R"+Version," | ");

SoftwareTests/SmokeTests.m

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22

33
properties
44
RootFolder
5-
end
5+
sparedEditors % Files already open when the test starts
6+
end % properties
67

78
properties (ClassSetupParameter)
89
Project = {currentProject()};
9-
end
10+
end % ClassSetupParameter
1011

1112
properties (TestParameter)
1213
File;
13-
end
14+
end % TestParameter
1415

1516
methods (TestParameterDefinition,Static)
1617

1718
function File = RetrieveFile(Project) %#ok<INUSD>
1819
% Retrieve student template files:
1920
RootFolder = currentProject().RootFolder;
20-
File = dir(fullfile(RootFolder,"Scripts","*.mlx"));
21+
File = dir(fullfile(RootFolder,"Scripts","*.m"));
22+
File = [File; dir(fullfile(RootFolder,"Scripts","*.mlx"))];
2123
File = {File.name};
2224
end
2325

24-
end
26+
end % Static TestParameterDefinition
2527

2628
methods (TestClassSetup)
2729

@@ -37,8 +39,28 @@ function SetUpSmokeTest(testCase,Project) %#ok<INUSD>
3739
testCase.log("Running in " + version)
3840
end
3941

40-
end
42+
end % TestClassSetup
43+
44+
methods(TestMethodSetup)
45+
function recordEditorsToSpare(testCase)
46+
testCase.sparedEditors = matlab.desktop.editor.getAll;
47+
testCase.sparedEditors = {testCase.sparedEditors.Filename};
48+
end
49+
end % TestMethodSetup
4150

51+
methods(TestMethodTeardown)
52+
function closeOpenedEditors_thenDeleteWorkingDir(testCase)
53+
openEditors = matlab.desktop.editor.getAll;
54+
for editor=openEditors(1:end)
55+
if any(strcmp(editor.Filename, testCase.sparedEditors))
56+
continue;
57+
end
58+
% if not on our list, close the file
59+
editor.close();
60+
end
61+
end
62+
end % TestMethodTeardown
63+
4264
methods(Test)
4365

4466
function SmokeRun(testCase,File)
@@ -90,13 +112,13 @@ function SmokeRun(testCase,File)
90112

91113
end
92114

93-
end
115+
end % Test Methods
94116

95117

96118
methods (Access = private)
97119

98120
function Path = CheckPreFile(testCase,Filename)
99-
PreFile = "Pre"+replace(Filename,".mlx",".m");
121+
PreFile = "Pre"+extractBefore(Filename,".m")+".m";
100122
PreFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PreFiles",PreFile);
101123
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
102124
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
@@ -112,7 +134,7 @@ function SmokeRun(testCase,File)
112134
end
113135

114136
function Path = CheckPostFile(testCase,Filename)
115-
PostFile = "Post"+replace(Filename,".mlx",".m");
137+
PostFile = "Post"+extractBefore(Filename,".m")+".m";
116138
PostFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PostFiles",PostFile);
117139
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
118140
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
@@ -125,6 +147,6 @@ function SmokeRun(testCase,File)
125147
Path = PostFilePath;
126148
end
127149

128-
end
150+
end % Private Methods
129151

130-
end
152+
end % Smoketests

0 commit comments

Comments
 (0)