Giter Site home page Giter Site logo

mathworks / continuous-integration-verification-simulink-models-gitlab Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 30.0 1.41 MB

This project is used in the explanation of the Technical Article 'Continuous Integration for Verification of Simulink® Models Using GitLab®' to describe a simple end-to-end example showing Model Based Design integration into GitLab®. Upon following the steps in the Technical Article, one can setup a running Continuous Integration pipeline performing verify, build, test and package stages to generate corresponding artifacts.

License: Other

MATLAB 87.47% XSLT 12.53%

continuous-integration-verification-simulink-models-gitlab's Introduction

Continuous Integration for Verification of Simulink® Models Using GitLab

This project is used in the explanation of the Technical Article 'Continuous Integration for Verification of Simulink® Models Using GitLab®' to describe a simple end-to-end example showing Model Based Design integration into GitLab®. Upon following the steps in the Technical Article, one can setup a running Continuous Integration pipeline performing verify, build, test and package stages to generate corresponding artifacts.

Quick Start guide

  1. Fork the repository to your own GitHub® account.
  2. Setup the GitLab® Runner, as outlined in the Technical Article.
  3. Create a new CI job using your forked repository.

Please refer the Technical Article 'Continuous Integration for Verification of Simulink Models Using GitLab' for detailed instructions on how to setup and run the continuous integration pipeline.

Folder Structure

Top-level directory layout

.
├── Data                                        # Data required to run the models and test cases.
├── Design                                      # This folder consists of sub-folders for each of the models in Cruise Control System.
├── Requirements                                # Requirements for the Cruise Control System.
├── tools                                       # Consists of files which can be useful while working with the models.
│   ├── help                                    # Contains files which describe the Cruise Control System and its behaviour.
│   ├── utilities                               # Consists of scripts and functions which are used for running the models.
├── .gitlab-ci.yml                              # Contains the stages to run in the parent pipeline and definitions for the child pipelines.
├── .driverSwRequest-gitlab-ci.yml              # Contains the stages to run in the child pipeline for the model 'DriverSwRequest'.
├── .cruiseControlMode-gitlab-ci.yml            # Contains the stages to run in the child pipeline for the model 'CruiseControlMode'.
├── .targetSpeedThrottle-gitlab-ci.yml          # Contains the stages to run in the child pipeline for the model 'TargetSpeedThrottle'.
├── .crs_controller-gitlab-ci.yml               # Contains the stages to run in the child pipeline for the model 'crs_controller'.
├── CruiseControlExample.prj                    # Can run this file in MATLAB® to setup the Simulink project
├── LICENSE
├── SECURITY.md
└── README.md

Design files

The Design folder consists of sub-folders for each of the models in the Cruise Control System.

The models are:

  1. crs_controller
  2. CruiseControlMode
  3. DriverSwRequest
  4. TargetSpeedThrottle

Each model folder consists of:

.
├── ...
├── Design
│   ├── crs_controller
│   │   ├── ...
│   ├── CruiseControlMode
│   │   ├── ...
│   ├── DriverSwRequest
│   │   ├── pipeline                 # Contains files related to 'DriverSwRequest' model's child pipeline.
│   │   │   ├── analyze              # Contains artifacts corresponding to different stages in the executed pipeline.
│   │   │   │   ├── verify           # Contains generated Model Advisor Report.
│   │   │   │   ├── build            # Contains generated Build Report.
│   │   │   │   ├── testing          # Contains generated Test Result Reports.
│   │   │   │   ├── package          # Contains generated Summary Report which is a summary of all the results from the previous stages.
│   │   │   ├── build                # Contains scripts to build the model.
│   │   │   ├── tests                # Contains scripts to run unit tests on the model.
│   │   │   ├── verify               # Contains scripts to run Model Advisor using ISO26262 checks on the model.
│   │   ├── specification            # Contains the Simulink®  Model file.
│   ├── TargetSpeedThrottle
│   │   ├── ...
└── ...

Tools and Utilities

.
├── ...
├── tools
│   ├── ...
│   ├── utilities
│   │   ├── config_data
│   │   │   ├── iso26262Checks.json              # The configuration file containing the Model Advisor Checks.
│   │   ├── pipeline_functions                   # Contains those scripts which are used for running the pipeline.
│   │   │   ├── deleteLogs.m                     # Deletes the logs generated while running the verify, build , test stages in the pipeline.
│   │   │   ├── generateHTMLReport.m             # Generates the HTML Summary report for a specified model.
│   │   │   ├── generateXMLFromLogs.m            # Generates a single XML file containg the results from the verify, build, test stages of the pipeline.
│   │   │   ├── modelAdvisorAction.m             # Runs the Model Advisor Checks for a specified model.
│   │   │   ├── modelBuildAction.m               # Script to build the model.
│   │   │   ├── modelTestsAction.m               # Runs the unit tests for the specified model.
│   │   │   ├── report.xsl                       # Template of the Summary Report that gets generated in the Package stage of the pipeline.
│   │   │   ├── runFolderTests.m                 # Runs the scripts in a specified folder for a specified model.
│   │   ├── setup
│   │   │   ├── cleanUp.m                        # Can be used to run at the end to remove generated files and folders.
│   │   │   ├── startUp.m                        # Configured to run on Project startup and can be used to modify locations where Simulink® Cache files and codegen folders are generated.
│   │   ├── user_scripts
│   │   │   ├── openModels.m                     # Opens all the models
│   │   │   ├── runAllTestsLocally.m             # Used for locally running all the scripts used in various stages of pipeline and can be run before pushing to remote.
└── ...

Products/Toolboxes Required

This project works on MATLAB 2020b, 2021a.

License

The license for Continuous Integration for Verification of Simulink Models Using GitLab is available in the license.txt file in this repository.

Community Support

MATLAB Central

Copyright 2021 The MathWorks, Inc.

continuous-integration-verification-simulink-models-gitlab's People

Contributors

jemimasadhika avatar jpkmw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

continuous-integration-verification-simulink-models-gitlab's Issues

GitLab Deploy jobs / jobs artifacts download by job name

Deploy jobs using API /projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_BRANCH/download?job=jobname
don't download artifacts from the current Pipeline but from the latest successful pipeline

This is highlighted by this simple GitLab pipeline reproducing this behavior and printing CI_JOB_ID

Looking at

- 'curl.exe --location --output "$ARTIFACTS_DOWNLOAD_PATH/Crs_ControllerArtifacts.zip" --header "PRIVATE-TOKEN: $CIPROJECTTOKEN" "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_BRANCH/download?job=Crs_ControllerPackage"'

- 'curl.exe --location --output "$ARTIFACTS_DOWNLOAD_PATH/CruiseControlModeArtifacts.zip" --header "PRIVATE-TOKEN: $CIPROJECTTOKEN" "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_BRANCH/download?job=CruiseControlModePackage"'

- 'curl.exe --location --output "$ARTIFACTS_DOWNLOAD_PATH/DriverSwRequestArtifacts.zip" --header "PRIVATE-TOKEN: $CIPROJECTTOKEN" "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_BRANCH/download?job=DriverSwRequestPackage"'

- 'curl.exe --location --output "$ARTIFACTS_DOWNLOAD_PATH/TargetSpeedThrottleArtifacts.zip" --header "PRIVATE-TOKEN: $CIPROJECTTOKEN" "$CI_SERVER_URL/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_BRANCH/download?job=TargetSpeedThrottlePackage"'

It doesn't seem that it is what is expected from the Deploy jobs.

As stated by the command above: All artifacts of previous stage can be found here but not as a single zip.
It could be changed by directly copying files to ARTIFACTS_DOWNLOAD_PATH

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.