Skip to content

Commit b44c972

Browse files
committed
Maintenance for R2024b
1) Add .gitattributes and .gitignore 2) Update GitHub CI 3) Include solutions in InstructorResources 4) Update to standardized smoke tests 5) Update the project to start and close the app 6) Remove checks and use of OldVersions, as well as OldVersions themselves 7) Remove links to unused and out of date files in the project 8) Update the links in README.md
1 parent 8584d37 commit b44c972

File tree

87 files changed

+770
-373
lines changed

Some content is hidden

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

87 files changed

+770
-373
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: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: MATLAB Build
2+
3+
# Controls when the action will run.
4+
on:
5+
push:
6+
branches: [ release ]
7+
pull_request:
8+
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
16+
17+
jobs:
18+
test:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
MATLABVersion: [R2024a,R2024b]
23+
runs-on: ubuntu-latest
24+
steps:
25+
# Checks-out your repository
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
35+
36+
# Sets up MATLAB
37+
- name: Setup MATLAB
38+
uses: matlab-actions/setup-matlab@v2
39+
with:
40+
release: ${{ matrix.MATLABVersion }}
41+
products: >
42+
Statistics_and_Machine_Learning_Toolbox
43+
# List required products above in the format shown (and uncomment them)
44+
# List of product strings:
45+
# Simulink
46+
# Statistics_and_Machine_Learning_Toolbox
47+
# Simulink_Coder
48+
# Econometrics_Toolbox
49+
# Deep_Learning_Toolbox
50+
51+
52+
# Run all the tests
53+
- name: Run SmokeTests
54+
uses: matlab-actions/run-command@v2
55+
with:
56+
command: openProject(pwd); RunAllTests;
57+
58+
# Upload the test results as artifact
59+
- name: Upload TestResults
60+
if: ${{ always() }}
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: TestResults_${{ matrix.MATLABVersion }}
64+
path: ./public/*
65+
overwrite: true
66+
67+
badge:
68+
if: ${{ always() }}
69+
needs: [test]
70+
strategy:
71+
fail-fast: false
72+
runs-on: ubuntu-latest
73+
steps:
74+
75+
# Checks-out your repository
76+
- uses: actions/checkout@v4
77+
78+
# Sets up R2023b
79+
- name: Setup MATLAB
80+
uses: matlab-actions/setup-matlab@v2
81+
with:
82+
release: R2024b
83+
84+
# Download the test results from artifact
85+
- name: Download All TestResults
86+
uses: actions/download-artifact@v4
87+
with:
88+
path: public
89+
pattern: TestResults_*
90+
merge-multiple: true
91+
92+
# Create the test results badge
93+
- name: Run PostSmokeTest
94+
uses: matlab-actions/run-command@v2
95+
with:
96+
command: openProject(pwd); PostSmokeTest;
97+
98+
# Deploy reports to GitHub pages
99+
- name: Setup Pages
100+
uses: actions/configure-pages@v5
101+
- name: Upload pages artifact
102+
uses: actions/upload-pages-artifact@v3
103+
with:
104+
path: public
105+
- name: Deploy to GitHub Pages
106+
id: deployment
107+
uses: actions/deploy-pages@v4
108+
109+
# Commit the JSON for the MATLAB releases badge
110+
- name: Commit changed files
111+
continue-on-error: true
112+
run: |
113+
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
114+
git config user.email "<>"
115+
git pull
116+
git add Images/TestedWith.json
117+
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
118+
git fetch
119+
git push

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ codegen/
4646

4747
# Project settings
4848
Utilities/ProjectSettings.mat
49+
50+
# GitLab page folder
51+
public/

.gitlab-ci.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ stages:
22
# Set up two testing paths
33
- setup
44
- test
5+
- deploy
56
- release
67

78
setup-job:
@@ -23,30 +24,30 @@ smoke-test:
2324
# Make sure that the runner you plan to use matches the tags
2425
- matlab
2526
stage: test
27+
parallel:
28+
matrix:
29+
- VERSION: [R2024a,R2024b]
2630
script:
27-
- matlab -batch "openProject(pwd);
28-
results = runtests(fullfile('SoftwareTests','SmokeTests.m'));
29-
disp(table(results)); assertSuccess(results);"
31+
- Set-Alias -Name matlab -Value "C:\Program Files\MATLAB\$VERSION\bin\matlab.exe"
32+
- matlab -batch "openProject(pwd);RunAllTests"
3033
when: always
3134
allow_failure: true
35+
artifacts:
36+
name: "$VERSION"
37+
paths:
38+
- public/*
39+
when: always
40+
3241

33-
smoke-test-solution:
42+
pages:
3443
tags:
3544
- matlab
36-
stage: release
37-
script:
38-
- matlab -batch "proj = openProject(pwd);
39-
addpath(genpath(proj.RootFolder));
40-
results = runtests(fullfile('InternalFiles','Tests','CI','SolnSmokeTests.m'));
41-
disp(table(results)); assertSuccess(results);"
42-
rules:
43-
# This test should always run when merging to main
44-
# And be available for manual running on any push
45-
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
46-
when: always
47-
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
48-
when: manual
49-
allow_failure: true
45+
stage: deploy
46+
script:
47+
- matlab -batch "openProject(pwd);PostSmokeTest;"
48+
artifacts:
49+
paths:
50+
- public
5051

5152
file-test:
5253
tags:
@@ -74,6 +75,7 @@ release-testing:
7475
- matlab -batch "proj = openProject(pwd);
7576
cd ..;
7677
addpath(genpath(fullfile('utilities','TestingResources')));
78+
addpath(genpath(fullfile('utilities','Tools')));
7779
runCMTests"
7880
rules:
7981
# This test should always run when merging to main

Data/.gitkeep

Whitespace-only changes.
75.4 KB
Binary file not shown.
71.3 KB
Binary file not shown.
231 KB
Binary file not shown.

0 commit comments

Comments
 (0)