Skip to content

Commit 0d2290e

Browse files
committed
Maintenance for R2024b
1) Update .gitattributes and .gitignore 2) Update CI workflow files 3) Rename all local functions we provide to be PascalCase while leaving some student-written functions in camelCase 4) Add Solutions to InstructorResources and make sure Script and Solution version match 5) Move some functions to a better location in the file per MATLAB language changes in R2024a to allow local functions to be defined in more places 6) Update the startup app, and update the project startup/shutdown process to match 7) Update the SoftwareTests to be more standardized and write appropriate pre/post files to set up and tear down testing conditions 8) Update the README.md with more precise Open in MATLAB Online links
1 parent 69097aa commit 0d2290e

File tree

79 files changed

+856
-197
lines changed

Some content is hidden

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

79 files changed

+856
-197
lines changed

.gitattributes

+1-1
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

+63-30
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,60 @@ 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:
14-
fail-fast: true
20+
fail-fast: false
1521
matrix:
16-
MATLABVersion: [R2021b,R2023a,R2023b]
22+
MATLABVersion: [R2024a,R2024b]
1723
runs-on: ubuntu-latest
1824
steps:
19-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20-
- uses: actions/checkout@v3
25+
# Checks-out your repository
26+
- uses: actions/checkout@v4
2127

22-
# Sets up MATLAB on the GitHub Actions runner
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
35+
36+
# 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

28-
# Run SmokeTests
51+
# Run all the tests
2952
- name: Run SmokeTests
30-
uses: matlab-actions/run-command@v1
53+
uses: matlab-actions/run-command@v2
3154
with:
32-
command: openProject(pwd); setenv('EDITOR','emacs'); results = runtests(fullfile("SoftwareTests","SmokeTests.m")); assertSuccess(results);
33-
34-
# Run FunctionTests
35-
- name: Run FunctionTests
36-
uses: matlab-actions/run-command@v1
37-
with:
38-
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","FunctionTests.m")); assertSuccess(results);
55+
command: openProject(pwd); RunAllTests;
3956

4057
# Upload the test results as artifact
4158
- name: Upload TestResults
42-
uses: actions/[email protected]
59+
if: ${{ always() }}
60+
uses: actions/upload-artifact@v4
4361
with:
44-
name: TestResults
45-
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt
62+
name: TestResults_${{ matrix.MATLABVersion }}
63+
path: ./public/*
64+
overwrite: true
4665

4766
badge:
4867
if: ${{ always() }}
@@ -53,33 +72,47 @@ jobs:
5372
steps:
5473

5574
# Checks-out your repository
56-
- uses: actions/checkout@v3
75+
- uses: actions/checkout@v4
5776

5877
# Sets up R2023b
5978
- name: Setup MATLAB
60-
uses: matlab-actions/setup-matlab@v1
79+
uses: matlab-actions/setup-matlab@v2
6180
with:
62-
release: R2023b
63-
81+
release: R2024b
82+
6483
# Download the test results from artifact
65-
- name: Download TestResults
66-
uses: actions/download-artifact@v2.1.1
84+
- name: Download All TestResults
85+
uses: actions/download-artifact@v4
6786
with:
68-
name: TestResults
69-
path: ./SoftwareTests/
70-
87+
path: public
88+
pattern: TestResults_*
89+
merge-multiple: true
90+
7191
# Create the test results badge
72-
- name: Run CreateBadge
73-
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
74102
with:
75-
command: openProject(pwd); CreateBadge;
103+
path: public
104+
- name: Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@v4
76107

77108
# Commit the JSON for the MATLAB releases badge
78109
- name: Commit changed files
79110
continue-on-error: true
80111
run: |
81112
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
82113
git config user.email "<>"
114+
git pull
115+
git add Images/TestedWith.json
83116
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
84117
git fetch
85118
git push

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ codegen/
4747
# Project settings
4848
Utilities/ProjectSettings.mat
4949

50+
# GitLab page folder
51+
public/

.gitlab-ci.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
stages:
2+
# Set up two testing paths
3+
- setup
4+
- test
5+
- deploy
6+
- release
7+
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 [email protected]:modular-curriculum-content/utilities.git
16+
- cd $CI_PROJECT_NAME
17+
allow_failure: false
18+
19+
20+
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+
41+
42+
pages:
43+
tags:
44+
- matlab
45+
stage: deploy
46+
script:
47+
- matlab -batch "openProject(pwd);PostSmokeTest;"
48+
artifacts:
49+
paths:
50+
- public
51+
52+
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
69+
70+
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

FunctionLibrary/CheckBuildWord.mlx

4.61 KB
Binary file not shown.

FunctionLibrary/CheckExercise5.mlx

4.84 KB
Binary file not shown.

FunctionLibrary/CheckMarkMidpoint.mlx

4.96 KB
Binary file not shown.

FunctionLibrary/ConwayGameSetup.mlx

4.21 KB
Binary file not shown.

FunctionLibrary/RunConwayGame.mlx

5.74 KB
Binary file not shown.

FunctionLibrary/ShowTaylor.mlx

104 KB
Binary file not shown.

FunctionLibrary/ShowTaylor2.mlx

3.65 KB
Binary file not shown.

FunctionLibrary/conwayGameSetup.mlx

-4.9 KB
Binary file not shown.
Binary file not shown.
58.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
49.2 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)