Skip to content

Commit 55a4a74

Browse files
committed
Maintenance update for R2024b
1) Add alt-text on equations 2) Fix remaining hard-coded colors to work better in dark theme 3) Remove unnecessary try/catch structures from instructional scripts 4) Rewrite the testing structure 5) Update the CI workflow files 6) Fix links that have moved
1 parent 23938a3 commit 55a4a74

File tree

92 files changed

+664
-331
lines changed

Some content is hidden

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

92 files changed

+664
-331
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,103 @@
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: [R2021a,R2021b,R2022a,R2022b,R2023a,R2023b]
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: >
42+
Symbolic_Math_Toolbox
43+
Statistics_and_Machine_Learning_Toolbox
44+
Image_Processing_Toolbox
2645
2746
# Run all the tests
2847
- name: Run SmokeTests
29-
uses: matlab-actions/run-command@v1
48+
uses: matlab-actions/run-command@v2
3049
with:
3150
command: openProject(pwd); RunAllTests;
3251

3352
# Upload the test results as artifact
3453
- name: Upload TestResults
35-
if: always()
36-
uses: actions/upload-artifact@v3.1.3
54+
uses: actions/upload-artifact@v4
3755
with:
38-
name: TestResults
39-
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt
40-
56+
name: TestResults_${{ matrix.MATLABVersion }}
57+
path: ./public/*
58+
overwrite: true
4159

42-
CreateBadge:
60+
badge:
4361
if: ${{ always() }}
44-
needs: [RunTests]
62+
needs: [test]
4563
strategy:
4664
fail-fast: false
4765
runs-on: ubuntu-latest
4866
steps:
4967

5068
# Checks-out your repository
51-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v4
5270

5371
# Sets up R2023b
5472
- name: Setup MATLAB
55-
uses: matlab-actions/setup-matlab@v1
73+
uses: matlab-actions/setup-matlab@v2
5674
with:
57-
release: R2023b
75+
release: R2024b
5876

5977
# Download the test results from artifact
60-
- name: Download TestResults
61-
uses: actions/download-artifact@v2.1.1
78+
- name: Download All TestResults
79+
uses: actions/download-artifact@v4
6280
with:
63-
name: TestResults
64-
path: ./SoftwareTests/
65-
81+
path: public
82+
pattern: TestResults_*
83+
merge-multiple: true
84+
6685
# Create the test results badge
67-
- name: Run CreateBadge
68-
uses: matlab-actions/run-command@v1
86+
- name: Run PostSmokeTest
87+
uses: matlab-actions/run-command@v2
88+
with:
89+
command: openProject(pwd); PostSmokeTest;
90+
91+
# Deploy reports to GitHub pages
92+
- name: Setup Pages
93+
uses: actions/configure-pages@v5
94+
- name: Upload pages artifact
95+
uses: actions/upload-pages-artifact@v3
6996
with:
70-
command: openProject(pwd); CreateBadge;
97+
path: public
98+
- name: Deploy to GitHub Pages
99+
id: deployment
100+
uses: actions/deploy-pages@v4
71101

72102
# Commit the JSON for the MATLAB releases badge
73103
- 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/

.gitlab-ci.yml

Lines changed: 87 additions & 0 deletions
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 git@insidelabs-git.mathworks.com: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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Images/image_10.png

-4.07 KB
Binary file not shown.

Images/image_13.png

-4.07 KB
Binary file not shown.

Images/image_9.png

-2.13 KB
Binary file not shown.

0 commit comments

Comments
 (0)