Skip to content

Commit

Permalink
Maintenance for R2024b
Browse files Browse the repository at this point in the history
1) Remove unnecessary files including Utilities/OldVersions, report, and
   buildutil
2) Update GitHub workflow file and supporting testing scripts in
   SoftwareTests
3) Update project contents, startup and shutdown files, and the
   ProjectStartupApp
4) Add InstructorResources with solutions
5) Make the image files more descriptive and fix the Open in MATLAB
   Online links in the README.md file
  • Loading branch information
eszmw committed Oct 21, 2024
1 parent de77321 commit 6e54942
Show file tree
Hide file tree
Showing 160 changed files with 2,307 additions and 2,981 deletions.
55 changes: 37 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ on:
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: [R2021b,R2022a,R2022b,R2023a,R2023b]
MATLABVersion: [R2024a,R2024b]
runs-on: ubuntu-latest
steps:
# Checks-out your repository
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Sets up a display server
- name: Start display server
Expand All @@ -32,7 +38,7 @@ jobs:
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.MATLABVersion }}
products: Symbolic_Math_Toolbox
products: # Simulink Statistics_and_Machine_Learning_Toolbox
# List required products above in the format shown (and uncomment them)
# List of product strings:
# Simulink
Expand All @@ -50,10 +56,12 @@ jobs:

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

badge:
if: ${{ always() }}
Expand All @@ -64,26 +72,38 @@ jobs:
steps:

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

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

# Download the test results from artifact
- name: Download TestResults
uses: actions/download-artifact@v2.1.1
- name: Download All TestResults
uses: actions/download-artifact@v4
with:
name: TestResults
path: ./SoftwareTests/

path: public
pattern: TestResults_*
merge-multiple: true

# Create the test results badge
- name: Run CreateBadge
uses: matlab-actions/run-command@v1
- 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:
command: openProject(pwd); CreateBadge;
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
Expand All @@ -96,4 +116,3 @@ jobs:
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
git fetch
git push
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,5 @@ codegen/
# Project settings
Utilities/ProjectSettings.mat

# Test results
SoftwareTests/TestResults_*

# GitLab page fodler
public/
# GitLab page folder
public/
90 changes: 84 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,87 @@
stages:
# Set up two testing paths
- setup
- test
- deploy
- release

matlab-test-job:
tags:
- matlab
stage: test
script:
- matlab -batch "openProject('Integrals.prj'); results = runtests('IncludeSubfolders', true); disp(table(results)); assertSuccess(results);"
setup-job:
tags:
- matlab
stage: setup
script:
- cd ..
- if (test-path utilities) { rm -r -force utilities }
- git clone [email protected]:modular-curriculum-content/utilities.git
- cd $CI_PROJECT_NAME
allow_failure: false


smoke-test:
# Smoke tests should run all the time
tags:
# Add additional tags like (e.g. - arduino) as required
# Make sure that the runner you plan to use matches the tags
- matlab
stage: test
parallel:
matrix:
- VERSION: [R2024a,R2024b]
script:
- 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


pages:
tags:
- matlab
stage: deploy
script:
- matlab -batch "openProject(pwd);PostSmokeTest;"
artifacts:
paths:
- public

file-test:
tags:
- matlab
stage: release
script:
- matlab -batch "proj = openProject(pwd);
addpath(proj.RootFolder+'/InternalFiles/Tests/CI');
results = runtests('OpenCloseFileTest.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

release-testing:
tags:
- matlab
stage: release
script:
- 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
# 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
Binary file modified Apps/CalculusFlashcards.mlapp
Binary file not shown.
Loading

0 comments on commit 6e54942

Please sign in to comment.