Skip to content

Commit bf6f5e4

Browse files
committed
Maintenance of Live Modules Update for 2024b+.
- Updated CI - Updated Smoke Tests - Plotting hard-coded color updates - Project structure updates - Added Instructor Solutions
1 parent 75965f8 commit bf6f5e4

File tree

61 files changed

+614
-301
lines changed

Some content is hidden

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

61 files changed

+614
-301
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*.slmx binary merge=mlAutoMerge
1717
*.sltx binary
1818
*.slxc binary
19-
*.slx binary merge=mlAutoMerge
19+
*.slx binary merge=mlAutoMerge linguist-language=Simulink
2020
*.slxp binary
2121

2222
## Other common binary file types

.github/workflows/ci.yml

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,109 @@
1-
name: Module Test
1+
name: MATLAB Build
22

33
# Controls when the action will run.
44
on:
55
push:
66
branches: [ release ]
77
pull_request:
88
branches: [ release ]
9+
workflow_dispatch:
10+
11+
# Add permission to write GitHub pages
12+
permissions:
13+
contents: write
14+
pages: write
15+
id-token: write
916

1017
jobs:
11-
RunTests:
18+
test:
1219
strategy:
1320
fail-fast: false
1421
matrix:
15-
MATLABVersion: [R2024a]
22+
MATLABVersion: [R2024a,R2024b]
1623
runs-on: ubuntu-latest
1724
steps:
1825
# Checks-out your repository
19-
- 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
2035
2136
# Sets up MATLAB
2237
- name: Setup MATLAB
23-
uses: matlab-actions/setup-matlab@v1
38+
uses: matlab-actions/setup-matlab@v2
2439
with:
2540
release: ${{ matrix.MATLABVersion }}
41+
products: MATLAB Simulink Control_System_Toolbox Simscape Simscape_Driveline Simscape_Multibody
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+
2650

2751
# Run all the tests
2852
- name: Run SmokeTests
29-
uses: matlab-actions/run-command@v1
53+
uses: matlab-actions/run-command@v2
3054
with:
3155
command: openProject(pwd); RunAllTests;
3256

3357
# Upload the test results as artifact
3458
- name: Upload TestResults
35-
if: always()
36-
uses: actions/upload-artifact@v3.1.3
59+
if: ${{ always() }}
60+
uses: actions/upload-artifact@v4
3761
with:
38-
name: TestResults
39-
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt
62+
name: TestResults_${{ matrix.MATLABVersion }}
63+
path: ./public/*
64+
overwrite: true
4065

41-
42-
CreateBadge:
66+
badge:
4367
if: ${{ always() }}
44-
needs: [RunTests]
68+
needs: [test]
4569
strategy:
4670
fail-fast: false
4771
runs-on: ubuntu-latest
4872
steps:
4973

5074
# Checks-out your repository
51-
- uses: actions/checkout@v3
75+
- uses: actions/checkout@v4
5276

5377
# Sets up R2023b
5478
- name: Setup MATLAB
55-
uses: matlab-actions/setup-matlab@v1
79+
uses: matlab-actions/setup-matlab@v2
5680
with:
57-
release: R2023b
81+
release: R2024b
5882

5983
# Download the test results from artifact
60-
- name: Download TestResults
61-
uses: actions/download-artifact@v2.1.1
84+
- name: Download All TestResults
85+
uses: actions/download-artifact@v4
6286
with:
63-
name: TestResults
64-
path: ./SoftwareTests/
65-
87+
path: public
88+
pattern: TestResults_*
89+
merge-multiple: true
90+
6691
# Create the test results badge
67-
- name: Run CreateBadge
68-
uses: matlab-actions/run-command@v1
92+
- name: Run PostSmokeTest
93+
uses: matlab-actions/run-command@v2
94+
with:
95+
command: openProject(pwd); PostSmokeTest;
96+
97+
# Deploy reports to GitHub pages
98+
- name: Setup Pages
99+
uses: actions/configure-pages@v5
100+
- name: Upload pages artifact
101+
uses: actions/upload-pages-artifact@v3
69102
with:
70-
command: openProject(pwd); CreateBadge;
103+
path: public
104+
- name: Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@v4
71107

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

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ codegen/
4747
# Project settings
4848
Utilities/ProjectSettings.mat
4949

50-
# Test results
51-
SoftwareTests/TestResults_*
50+
# GitLab page folder
51+
public/

Images/TestedWith.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"schemaVersion":1,"label":"Tested with","color":"success","message":"R2024a"}
1+
{"schemaVersion":1,"label":"Tested with","color":"success","message":"R2024a | R2024b"}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

README.md

Lines changed: 46 additions & 40 deletions
Large diffs are not rendered by default.

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

0 commit comments

Comments
 (0)