Skip to content

Commit 0093cf7

Browse files
committed
Update for R2024b maintenance cycle
1 parent 21626cf commit 0093cf7

34 files changed

+352
-253
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,59 @@ on:
88
branches: [ release ]
99
workflow_dispatch:
1010

11+
# Add permission to write GitHub pages
12+
permissions:
13+
contents: write
14+
pages: write
15+
id-token: write
16+
1117
jobs:
1218
test:
1319
strategy:
1420
fail-fast: false
1521
matrix:
16-
MATLABVersion: [R2021a,R2021b,R2022a,R2022b,R2023a,R2023b]
22+
MATLABVersion: [R2024a,R2024b]
1723
runs-on: ubuntu-latest
1824
steps:
1925
# Checks-out your repository
20-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
27+
28+
# Sets up a display server
29+
- name: Start display server
30+
if: ${{ always() }}
31+
run: |
32+
sudo apt-get install xvfb
33+
Xvfb :99 &
34+
echo "DISPLAY=:99" >> $GITHUB_ENV
2135
2236
# Sets up MATLAB
2337
- name: Setup MATLAB
24-
uses: matlab-actions/setup-matlab@v1
38+
uses: matlab-actions/setup-matlab@v2
2539
with:
2640
release: ${{ matrix.MATLABVersion }}
41+
products: # Simulink Statistics_and_Machine_Learning_Toolbox
42+
# List required products above in the format shown (and uncomment them)
43+
# List of product strings:
44+
# Simulink
45+
# Statistics_and_Machine_Learning_Toolbox
46+
# Simulink_Coder
47+
# Econometrics_Toolbox
48+
# Deep_Learning_Toolbox
49+
2750

2851
# Run all the tests
2952
- name: Run SmokeTests
30-
uses: matlab-actions/run-command@v1
53+
uses: matlab-actions/run-command@v2
3154
with:
3255
command: openProject(pwd); RunAllTests;
3356

3457
# Upload the test results as artifact
3558
- name: Upload TestResults
36-
uses: actions/upload-artifact@v3.1.3
59+
uses: actions/upload-artifact@v4
3760
with:
38-
name: TestResults
39-
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt
61+
name: TestResults_${{ matrix.MATLABVersion }}
62+
path: ./public/*
63+
overwrite: true
4064

4165
badge:
4266
if: ${{ always() }}
@@ -47,26 +71,38 @@ jobs:
4771
steps:
4872

4973
# Checks-out your repository
50-
- uses: actions/checkout@v3
74+
- uses: actions/checkout@v4
5175

5276
# Sets up R2023b
5377
- name: Setup MATLAB
54-
uses: matlab-actions/setup-matlab@v1
78+
uses: matlab-actions/setup-matlab@v2
5579
with:
56-
release: R2023b
80+
release: R2024b
5781

5882
# Download the test results from artifact
59-
- name: Download TestResults
60-
uses: actions/download-artifact@v2.1.1
83+
- name: Download All TestResults
84+
uses: actions/download-artifact@v4
6185
with:
62-
name: TestResults
63-
path: ./SoftwareTests/
64-
86+
path: public
87+
pattern: TestResults_*
88+
merge-multiple: true
89+
6590
# Create the test results badge
66-
- name: Run CreateBadge
67-
uses: matlab-actions/run-command@v1
91+
- name: Run PostSmokeTest
92+
uses: matlab-actions/run-command@v2
93+
with:
94+
command: openProject(pwd); PostSmokeTest;
95+
96+
# Deploy reports to GitHub pages
97+
- name: Setup Pages
98+
uses: actions/configure-pages@v5
99+
- name: Upload pages artifact
100+
uses: actions/upload-pages-artifact@v3
68101
with:
69-
command: openProject(pwd); CreateBadge;
102+
path: public
103+
- name: Deploy to GitHub Pages
104+
id: deployment
105+
uses: actions/deploy-pages@v4
70106

71107
# Commit the JSON for the MATLAB releases badge
72108
- name: Commit changed files

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ Utilities/ProjectSettings.mat
5050
# Test results
5151
SoftwareTests/TestResults_*
5252

53-
# GitLab page fodler
54-
public/
53+
# GitLab page folder
54+
public/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

MainMenu.mlx

-8 Bytes
Binary file not shown.

README.md

Lines changed: 116 additions & 109 deletions
Large diffs are not rendered by default.

Scripts/ArcticSeaIce.mlx

23.4 KB
Binary file not shown.

Scripts/GlobalTemperature.mlx

151 Bytes
Binary file not shown.

Scripts/MultispectralImaging.mlx

11 Bytes
Binary file not shown.

Scripts/MultispectralIndices.mlx

9 Bytes
Binary file not shown.

SoftwareTests/CheckTestResults.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
end
55

66
properties (ClassSetupParameter)
7-
Project = {''};
7+
Project = {currentProject()};
88
end
99

1010
properties (TestParameter)
@@ -15,8 +15,8 @@
1515
methods (TestParameterDefinition,Static)
1616

1717
function Version = GetResults(Project)
18-
RootFolder = currentProject().RootFolder;
19-
Version = dir(fullfile(RootFolder,"SoftwareTests","TestResults*.txt"));
18+
RootFolder = Project.RootFolder;
19+
Version = dir(fullfile(RootFolder,"public","TestResults*.txt"));
2020
Version = extractBetween([Version.name],"TestResults_",".txt");
2121
end
2222

@@ -37,9 +37,11 @@ function SetUpSmokeTest(testCase,Project)
3737
methods(Test)
3838

3939
function CheckResults(testCase,Version)
40-
File = fullfile("SoftwareTests","TestResults_"+Version+".txt");
40+
File = fullfile("public","TestResults_"+Version+".txt");
4141
Results = readtable(File,TextType="string");
42-
testCase.verifyTrue(all(Results.Passed));
42+
if ~all(Results.Passed)
43+
error("Some of the tests did not pass.")
44+
end
4345
end
4446

4547
end

SoftwareTests/CreateBadge.m

Lines changed: 0 additions & 28 deletions
This file was deleted.

SoftwareTests/FunctionTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
classdef FunctionTests < matlab.unittest.TestCase
22

3+
% https://www.mathworks.com/help/matlab/matlab_prog/use-parameters-in-class-based-tests.html
4+
35
methods(Test)
46

57
end % methods
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for ArcticSeaIce.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for ArcticSeaIceSoln.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for GlobalTemperature.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for GlobalTemperatureSoln.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for MultispectralImaging.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for MultispectralImagingSoln.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for MultispectralIndices.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% Post-run script for MultispectralIndicesSoln.mlx
2+
% ---- Post-run commands -----
3+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for ArcticSeaIce.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for ArcticSeaIceSoln.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for GlobalTemperature.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for GlobalTemperatureSoln.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for MultispectralImaging.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for MultispectralImagingSoln.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for MultispectralIndices.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
% Pre-run script for MultispectralIndicesSoln.mlx
2+
% ---- Known Issues -----
3+
KnownIssuesID = "";
4+
% ---- Pre-run commands -----
5+

SoftwareTests/RunAllTests.m

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
1-
function RunAllTest(EnableReport,ReportFolder)
1+
function RunAllTests(ShowReport)
22
arguments
3-
EnableReport (1,1) logical = false;
4-
ReportFolder (1,1) string = "public";
3+
ShowReport (1,1) logical = false;
54
end
65

76
import matlab.unittest.plugins.TestReportPlugin;
87

98
% Create a runner
109
Runner = matlab.unittest.TestRunner.withTextOutput;
11-
if EnableReport
12-
Folder = fullfile(currentProject().RootFolder,ReportFolder);
13-
if ~isfolder(Folder)
14-
mkdir(Folder)
15-
else
16-
rmdir(Folder,'s')
17-
mkdir(Folder)
18-
end
19-
Plugin = TestReportPlugin.producingHTML(Folder,...
20-
"IncludingPassingDiagnostics",true,...
21-
"IncludingCommandWindowText",true,...
22-
"LoggingLevel",matlab.automation.Verbosity(1));
23-
Runner.addPlugin(Plugin);
10+
Folder = fullfile(currentProject().RootFolder,"public",version("-release"));
11+
if ~isfolder(Folder)
12+
mkdir(Folder)
13+
else
14+
rmdir(Folder,'s')
15+
mkdir(Folder)
2416
end
17+
Plugin = TestReportPlugin.producingHTML(Folder,...
18+
"IncludingPassingDiagnostics",true,...
19+
"IncludingCommandWindowText",true,...
20+
"LoggingLevel",matlab.automation.Verbosity(1));
21+
Runner.addPlugin(Plugin);
22+
2523

2624
% Create the test suite with SmokeTest and Function test if they exist
2725
Suite = testsuite("SmokeTests");
2826
Suite = [Suite testsuite("FunctionTests")];
27+
Suite = [Suite testsuite("SolnSmokeTests")];
2928

3029
% Run the test suite
3130
Results = Runner.run(Suite);
3231

33-
if EnableReport
32+
if ShowReport
3433
web(fullfile(Folder,"index.html"))
35-
else
36-
T = table(Results);
37-
disp(newline + "Test summary:")
38-
disp(T)
3934
end
4035

4136
% Format the results in a table and save them
4237
ResultsTable = table(Results')
43-
writetable(ResultsTable,fullfile("SoftwareTests","TestResults_"+release_version+".txt"));
38+
writetable(ResultsTable,fullfile(currentProject().RootFolder,...
39+
"public","TestResults_"+version("-release")+".txt"));
4440

4541
% Assert success of test
4642
assertSuccess(Results);

0 commit comments

Comments
 (0)