Skip to content

Commit

Permalink
Added new module template and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
callieEDU committed Nov 29, 2023
1 parent efca51a commit 6244aa5
Show file tree
Hide file tree
Showing 302 changed files with 606,220 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.fig binary
*.mat binary
*.mdl binary diff merge=mlAutoMerge
*.mdlp binary
*.mexa64 binary
*.mexw64 binary
*.mexmaci64 binary
*.mlapp binary linguist-language=MATLAB
*.mldatx binary
*.mlproj 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
*.slxp binary

## Other common binary file types
*.docx binary
*.exe binary
*.jpg binary
*.pdf binary
*.png binary
*.xlsx binary

# Ignore HTML

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

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

jobs:
test:
strategy:
fail-fast: false
matrix:
MATLABVersion: [R2023a,R2023b]
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Sets up MATLAB on the GitHub Actions runner
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: ${{ matrix.MATLABVersion }}

# Run SmokeTests
- name: Run SmokeTests
uses: matlab-actions/run-command@v1
with:
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","SmokeTests.m")); assertSuccess(results);

# Run FunctionTests
- name: Run FunctionTests
uses: matlab-actions/run-command@v1
with:
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","FunctionTests.m")); assertSuccess(results);

# Upload the test results as artifact
- name: Upload TestResults
uses: actions/[email protected]
with:
name: TestResults
path: ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt

# Download the test results from artifact
- name: Download TestResults
uses: actions/[email protected]
with:
name: TestResults
path: ./SoftwareTests/

# Create the test results badge
- name: Run CreateBadge
uses: matlab-actions/run-command@v1
with:
command: openProject(pwd); results = runtests(fullfile("SoftwareTests","CreateBadge.m"));

# 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 commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
git fetch
git push
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# List of untracked files to ignore

# Autosave files
*.asv
*.m~
*.autosave
*.slx.r*
*.mdl.r*

# MATLAB Drive
*.MATLABDriveTag

# Compiled files
*.mex*
*.p

# Compressed files
*.zip

# Packaged app and toolbox files
*.mlappinstall
*.mltbx

# Deployable archives
*.ctf

# Generated helpsearch folders
helpsearch*/

# Defined Simulink cache folder
Utilities/SimulinkCache/*

# Standard code generation folders
slprj/
sccprj/
codegen/

# Code generation file
*.eep
*.elf
*.hex
*.bin

# Cache files
*.slxc

# Project settings
Utilities/ProjectSettings.mat

# Test results
SoftwareTests/TestResults_*
85 changes: 85 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
stages:
# Set up two testing paths
- setup
- test
- release

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
script:
- matlab -batch "openProject(pwd);
results = runtests(fullfile('SoftwareTests','SmokeTests.m'));
disp(table(results)); assertSuccess(results);"
when: always
allow_failure: true

smoke-test-solution:
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

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')));
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
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

>_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._
Thank you for your interest in contributing to a MathWorks repository! We encourage contributions large and small to this repository.

**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!

## How to give feedback
* **Send us an email:** Contact the [MathWorks teaching resources team.](mailto:[email protected])
* **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.

## How to contribute to the repository
* **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.
* **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.
* **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.

## Guidelines

We don't have best practices for writing MATLAB&reg; code, but we do have some recommendations:

* 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)
* [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/)
* 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).
* 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.

**Again, thanks for contributing, and we look forward to your issues and pull requests!**
Empty file added Data/.gitkeep
Empty file.
Binary file added Data/STL/bb_arm1.stl
Binary file not shown.
Binary file added Data/STL/bb_arm2.stl
Binary file not shown.
Binary file added Data/STL/bb_beam.stl
Binary file not shown.
Binary file added Data/STL/bb_hinge.stl
Binary file not shown.
Binary file added Data/STL/bb_leftstop.stl
Binary file not shown.
Binary file added Data/STL/bb_motor.stl
Binary file not shown.
Binary file added Data/STL/bb_motorbracket.stl
Binary file not shown.
Binary file added Data/STL/bb_motorshaft.stl
Binary file not shown.
Binary file added Data/STL/bb_rightstand.stl
Binary file not shown.
Binary file added Data/STL/bb_rightstop.stl
Binary file not shown.
Binary file added Data/STL/bp_horn1.stl
Binary file not shown.
Binary file added Data/STL/bp_horn2.stl
Binary file not shown.
Binary file added Data/STL/bp_link1.stl
Binary file not shown.
Binary file added Data/STL/bp_link2.stl
Binary file not shown.
Binary file added Data/STL/bp_servo1.stl
Binary file not shown.
Binary file added Data/STL/bp_servo2.stl
Binary file not shown.
Binary file added Data/STL/bp_servostand1.stl
Binary file not shown.
Binary file added Data/STL/bp_servostand2.stl
Binary file not shown.
Binary file added Data/STL/bp_stand.stl
Binary file not shown.
Binary file added Data/STL/bp_tray.stl
Binary file not shown.
Binary file added Data/STL/bp_universalCylinders.stl
Binary file not shown.
Loading

0 comments on commit 6244aa5

Please sign in to comment.