Skip to content

Commit 0fdb80a

Browse files
committed
Rewrite for 2.0 version
1 parent e2f07ee commit 0fdb80a

File tree

172 files changed

+1667
-442
lines changed

Some content is hidden

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

172 files changed

+1667
-442
lines changed

Diff for: .gitattributes

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*.mexa64 binary
66
*.mexw64 binary
77
*.mexmaci64 binary
8-
*.mlapp binary
8+
*.mlapp binary linguist-language=MATLAB
99
*.mldatx binary
1010
*.mlproj binary
1111
*.mlx binary merge=mlAutoMerge linguist-language=MATLAB
@@ -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

Diff for: .github/workflows/ci.yml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
jobs:
12+
test:
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
MATLABVersion: [R2021a,R2021b,R2022a,R2022b,R2023a,R2023b]
17+
runs-on: ubuntu-latest
18+
steps:
19+
# Checks-out your repository
20+
- uses: actions/checkout@v3
21+
22+
# Sets up a display server
23+
- name: Start display server
24+
if: ${{ always() }}
25+
run: |
26+
sudo apt-get install xvfb
27+
Xvfb :99 &
28+
echo "DISPLAY=:99" >> $GITHUB_ENV
29+
30+
# Sets up MATLAB
31+
- name: Setup MATLAB
32+
uses: matlab-actions/setup-matlab@v2
33+
with:
34+
release: ${{ matrix.MATLABVersion }}
35+
products: # Simulink Statistics_and_Machine_Learning_Toolbox
36+
# List required products above in the format shown (and uncomment them)
37+
# List of product strings:
38+
# Simulink
39+
# Statistics_and_Machine_Learning_Toolbox
40+
# Simulink_Coder
41+
# Econometrics_Toolbox
42+
# Deep_Learning_Toolbox
43+
44+
45+
# Run all the tests
46+
- name: Run SmokeTests
47+
uses: matlab-actions/run-command@v2
48+
with:
49+
command: openProject(pwd); RunAllTests;
50+
51+
# Upload the test results as artifact
52+
- name: Upload TestResults
53+
uses: actions/upload-artifact@v3.1.3
54+
with:
55+
name: TestResults
56+
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt
57+
58+
badge:
59+
if: ${{ always() }}
60+
needs: [test]
61+
strategy:
62+
fail-fast: false
63+
runs-on: ubuntu-latest
64+
steps:
65+
66+
# Checks-out your repository
67+
- uses: actions/checkout@v3
68+
69+
# Sets up R2023b
70+
- name: Setup MATLAB
71+
uses: matlab-actions/setup-matlab@v1
72+
with:
73+
release: R2023b
74+
75+
# Download the test results from artifact
76+
- name: Download TestResults
77+
uses: actions/download-artifact@v2.1.1
78+
with:
79+
name: TestResults
80+
path: ./SoftwareTests/
81+
82+
# Create the test results badge
83+
- name: Run CreateBadge
84+
uses: matlab-actions/run-command@v1
85+
with:
86+
command: openProject(pwd); CreateBadge;
87+
88+
# Commit the JSON for the MATLAB releases badge
89+
- name: Commit changed files
90+
continue-on-error: true
91+
run: |
92+
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
93+
git config user.email "<>"
94+
git pull
95+
git add Images/TestedWith.json
96+
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
97+
git fetch
98+
git push

Diff for: .gitignore

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
# List of untracked files to ignore
2-
3-
*.zip
4-
*.pyc
5-
*/*.pyc
62
*.vs
7-
*TestOutput
8-
MATLAB-Live-Task-for-Python
9-
__pycache__
103

114
# Prevent accidentally committing your API key
125
myAPIkey.txt
136

14-
# List of untracked files to ignore
7+
# Live Task Repository
8+
MATLAB-Live-Task-for-Python
159

1610
# Autosave files
1711
*.asv
@@ -53,9 +47,18 @@ codegen/
5347
*.elf
5448
*.hex
5549
*.bin
50+
__pycache__
51+
*.pyc
52+
*/*.pyc
5653

5754
# Cache files
5855
*.slxc
5956

6057
# Project settings
6158
Utilities/ProjectSettings.mat
59+
60+
# Test results
61+
SoftwareTests/TestResults_*
62+
63+
# GitLab page folder
64+
public/

Diff for: .gitlab-ci.yml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
script:
28+
- matlab -batch "openProject(pwd);RunAllTests(true)"
29+
when: always
30+
allow_failure: true
31+
artifacts:
32+
paths:
33+
- public/*
34+
expire_in: 1 years
35+
36+
pages:
37+
tags:
38+
- matlab
39+
stage: deploy
40+
script:
41+
- echo 'Deploying pages'
42+
artifacts:
43+
paths:
44+
- public
45+
46+
smoke-test-solution:
47+
tags:
48+
- matlab
49+
stage: release
50+
script:
51+
- matlab -batch "proj = openProject(pwd);
52+
addpath(genpath(proj.RootFolder));
53+
results = runtests(fullfile('InternalFiles','Tests','CI','SolnSmokeTests.m'));
54+
disp(table(results)); assertSuccess(results);"
55+
rules:
56+
# This test should always run when merging to main
57+
# And be available for manual running on any push
58+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
59+
when: always
60+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
61+
when: manual
62+
allow_failure: true
63+
64+
file-test:
65+
tags:
66+
- matlab
67+
stage: release
68+
script:
69+
- matlab -batch "proj = openProject(pwd);
70+
addpath(proj.RootFolder+'/InternalFiles/Tests/CI');
71+
results = runtests('OpenCloseFileTest.m');
72+
disp(table(results)); assertSuccess(results);"
73+
rules:
74+
# This test should always run when merging to main
75+
# And be available for manual running on any push
76+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
77+
when: always
78+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
79+
when: manual
80+
allow_failure: true
81+
82+
release-testing:
83+
tags:
84+
- matlab
85+
stage: release
86+
script:
87+
- matlab -batch "proj = openProject(pwd);
88+
cd ..;
89+
addpath(genpath(fullfile('utilities','TestingResources')));
90+
runCMTests"
91+
rules:
92+
# This test should always run when merging to main
93+
# And be available for manual running on any push
94+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
95+
when: always
96+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
97+
when: manual
98+
allow_failure: true

Diff for: Apps/CurrentWeatherAppDemo.mlapp

57.3 KB
Binary file not shown.

Diff for: Apps/CurrentWeatherAppStart.mlapp

26.4 KB
Binary file not shown.

Diff for: Apps/WeatherDisplay.mlapp

83.2 KB
Binary file not shown.

Diff for: CONTRIBUTING.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing
2+
3+
>_If you believe you have discovered a security vulnerability, please **do not** open an issue or make a pull request. Follow the instructions in the [SECURITY.md](SECURITY.md) file in this repository._
4+
5+
Thank you for your interest in contributing to a MathWorks repository! We encourage contributions large and small to this repository.
6+
7+
**Contributions do not have to be code!** If you see a way to explain things more clearly or a great example of how to use something, please contribute it (or a link to your content). We welcome issues even if you don't code the solution. We also welcome pull requests to resolve issues that we haven't gotten to yet!
8+
9+
## How to give feedback
10+
* **Send us an email:** Contact the [MathWorks teaching resources team.](mailto:onlineteaching@mathworks.com)
11+
* **Open an issue:** Start by [creating an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) in the repository that you're interested in. That will start a conversation with the maintainer. When you are creating a bug report, please include as many details as possible. Please remember that other people do not have your background or understanding of the issue; make sure you are clear and complete in your description.
12+
13+
## How to contribute to the repository
14+
* **Work in your own public fork:** If you choose to make a contribution, you should [fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo). This creates an editable copy on GitHub where you can write, test, and refine your changes. We suggest that you keep your changes small and focused on the issue you submitted.
15+
* **Sign a Contributor License Agreement (CLA):** We require that all outside contributors sign a [CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement) before we can accept your contribution. When you create a pull request (see below), we'll reach out to you if you do not already have one on file. Essentially, the CLA gives us permission to publish your contribution as part of the repository.
16+
* **Make a pull request:** "[Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)" is a confusing term, but it means exactly what it says: You're requesting that the maintainers of the repository pull your changes in. If you don't have a CLA on file, we'll reach out to you. Your contribution will be reviewed, and we may ask you to revise your pull request based on our feedback. Once everyone is satisfied, we'll merge your pull request into the repository.
17+
18+
## Guidelines
19+
20+
We don't have best practices for writing MATLAB&reg; code, but we do have some recommendations:
21+
22+
* You should not have any warnings or errors in the [code analyzer report](http://www.mathworks.com/help/matlab/matlab_prog/matlab-code-analyzer-report.html)
23+
* [Loren Shure's blog](https://blogs.mathworks.com/loren) has [great advice on improving your MATLAB code](https://blogs.mathworks.com/loren/category/best-practice/)
24+
* Examples should be written as [live scripts](https://www.mathworks.com/help/matlab/matlab_prog/what-is-a-live-script-or-function.html) or [Simulink&reg; models](https://www.mathworks.com/help/simulink/index.html).
25+
* We adhere to the [CommonMark](https://commonmark.org/) specification where it does not conflict with GitHub rendering. If you edit your Markdown in Visual Studio Code or a similar editor, it uses [markdownlint](https://github.com/DavidAnson/markdownlint) to highlight issues in your Markdown.
26+
27+
**Again, thanks for contributing, and we look forward to your issues and pull requests!**

Diff for: CheckingTheWeather.mlx

-46.6 KB
Binary file not shown.

Diff for: FunctionLibrary/.gitkeep

Whitespace-only changes.

Diff for: FunctionLibrary/CheckPythonVersion.mlx

4.62 KB
Binary file not shown.
File renamed without changes.

Diff for: HelperFunctions/Navigation.mlx

-121 KB
Binary file not shown.

Diff for: HelperFunctions/OpenOverview.m

-10
This file was deleted.

0 commit comments

Comments
 (0)