Skip to content

Commit

Permalink
Maintenance for R2024b
Browse files Browse the repository at this point in the history
1) Update CI workflows and the tests that will be run by them with the
   results posted to Pages
2) Update the project and the startup app
3) Add solutions to the InstructorResources folder
4) Remove OldVersions and clarify support for R2024a, R2024b, and MATLAB
   Online
5) Update the README.mlx and README.md with better image names and
   MATLAB Online links
6) Remove buildutils and reports as part of the prior CI workflow
  • Loading branch information
eszmw committed Oct 23, 2024
1 parent e2a7145 commit 8a4c39c
Show file tree
Hide file tree
Showing 75 changed files with 937 additions and 558 deletions.
14 changes: 10 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
*.mat binary
*.mdl binary diff merge=mlAutoMerge
*.mdlp binary
*.mex* binary
*.mlapp binary
*.mexa64 binary
*.mexw64 binary
*.mexmaci64 binary
*.mlapp binary linguist-language=MATLAB
*.mldatx binary
*.mlproj binary
*.mlx binary
*.mlx binary merge=mlAutoMerge linguist-language=MATLAB
*.p binary
*.sfx binary
*.sldd binary
*.slreqx binary merge=mlAutoMerge
*.slmx binary merge=mlAutoMerge
*.sltx binary
*.slxc binary
*.slx binary merge=mlAutoMerge
*.slx binary merge=mlAutoMerge linguist-language=Simulink
*.slxp binary

## Other common binary file types
Expand All @@ -24,3 +26,7 @@
*.pdf binary
*.png binary
*.xlsx binary

# Ignore HTML

*.html linguist-detectable=false
123 changes: 123 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: MATLAB Build

# Controls when the action will run.
on:
push:
branches: [ release ]
pull_request:
branches: [ release ]
workflow_dispatch:

# Add permission to write GitHub pages
permissions:
contents: write
pages: write
id-token: write

jobs:
test:
strategy:
fail-fast: false
matrix:
MATLABVersion: [R2024a,R2024b]
runs-on: ubuntu-latest
steps:
# Checks-out your repository
- uses: actions/checkout@v4

# Sets up a display server
- name: Start display server
if: ${{ always() }}
run: |
sudo apt-get install xvfb
Xvfb :99 &
echo "DISPLAY=:99" >> $GITHUB_ENV
# Sets up MATLAB
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.MATLABVersion }}
products: >
Symbolic_Math_Toolbox
Image_Processing_Toolbox
Statistics_and_Machine_Learning_Toolbox
Deep_Learning_Toolbox
# Simulink
# List required products above in the format shown (and uncomment them)
# List of product strings:
# Simulink
# Statistics_and_Machine_Learning_Toolbox
# Simulink_Coder
# Econometrics_Toolbox
# Deep_Learning_Toolbox


# Run all the tests
- name: Run SmokeTests
uses: matlab-actions/run-command@v2
with:
command: openProject(pwd); RunAllTests;

# Upload the test results as artifact
- name: Upload TestResults
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: TestResults_${{ matrix.MATLABVersion }}
path: ./public/*
overwrite: true

badge:
if: ${{ always() }}
needs: [test]
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:

# Checks-out your repository
- uses: actions/checkout@v4

# Sets up R2023b
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2024b

# Download the test results from artifact
- name: Download All TestResults
uses: actions/download-artifact@v4
with:
path: public
pattern: TestResults_*
merge-multiple: true

# Create the test results badge
- name: Run PostSmokeTest
uses: matlab-actions/run-command@v2
with:
command: openProject(pwd); PostSmokeTest;

# Deploy reports to GitHub pages
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

# Commit the JSON for the MATLAB releases badge
- name: Commit changed files
continue-on-error: true
run: |
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
git config user.email "<>"
git pull
git add Images/TestedWith.json
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
git fetch
git push
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ codegen/

# Project settings
Utilities/ProjectSettings.mat

# GitLab page folder
public/
51 changes: 21 additions & 30 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,20 @@ stages:
# Set up two testing paths
- setup
- test
- deploy
- release
- cleanup

setup-job:
tags:
- matlab
stage: setup
script:
- cd ..
- cd ..
- if (test-path utilities) { rm -r -force utilities }
- git clone git@insidelabs-git.mathworks.com:modular-curriculum-content/utilities.git
- cd $CI_PROJECT_NAME
allow_failure: false

#cleanup-job:
# tags:
# - matlab
# stage: cleanup
# script:
# - cd ..
# - rm -r -force utilities
# - cd $CI_PROJECT_NAME
# allow_failure: false


smoke-test:
# Smoke tests should run all the time
Expand All @@ -34,30 +24,30 @@ smoke-test:
# Make sure that the runner you plan to use matches the tags
- matlab
stage: test
parallel:
matrix:
- VERSION: [R2024a,R2024b]
script:
- matlab -batch "openProject(pwd);
results = runtests(fullfile('SoftwareTests','SmokeTests.m'));
disp(table(results)); assertSuccess(results);"
- Set-Alias -Name matlab -Value "C:\Program Files\MATLAB\$VERSION\bin\matlab.exe"
- matlab -batch "openProject(pwd);RunAllTests"
when: always
allow_failure: true
artifacts:
name: "$VERSION"
paths:
- public/*
when: always

smoke-test-solution:

pages:
tags:
- matlab
stage: release
script:
- matlab -batch "proj = openProject(pwd);
addpath(genpath(proj.RootFolder));
results = runtests(fullfile('InternalFiles','Tests','CI','SolnSmokeTests.m'));
disp(table(results)); assertSuccess(results);"
rules:
# This test should always run when merging to main
# And be available for manual running on any push
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
when: always
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
when: manual
allow_failure: true
stage: deploy
script:
- matlab -batch "openProject(pwd);PostSmokeTest;"
artifacts:
paths:
- public

file-test:
tags:
Expand Down Expand Up @@ -85,6 +75,7 @@ release-testing:
- matlab -batch "proj = openProject(pwd);
cd ..;
addpath(genpath(fullfile('utilities','TestingResources')));
addpath(genpath(fullfile('utilities','Tools')));
runCMTests"
rules:
# This test should always run when merging to main
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added InstructorResources/Solutions/MomentsSoln.mlx
Binary file not shown.
Binary file not shown.
Binary file added InstructorResources/Solutions/RoboticsSoln.mlx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 8a4c39c

Please sign in to comment.