Continuous Integration with MATLAB on CI Platforms
You can use different continuous integration (CI) platforms to run MATLAB® code and Simulink® models as part of your automated pipeline of tasks. To facilitate building and testing software with continuous integration, MATLAB seamlessly integrates with several CI platforms, such as Azure® DevOps, CircleCI®, and Jenkins®. You can use these platforms to:
Run a build using the MATLAB build tool.
Run MATLAB and Simulink tests and generate artifacts, such as JUnit test results and Cobertura code coverage reports.
Run MATLAB scripts, functions, and statements.
Depending on the CI platform, you might:
Configure your pipeline using a script or user interface.
Set up the platform to run MATLAB on-premises or in the cloud.
Azure DevOps
To perform continuous integration with MATLAB on Azure DevOps, install an extension to your Azure DevOps organization. To run MATLAB in your pipeline, use the extension to author your pipeline in a file
named azure-pipelines.yml
in the root of your repository. You can
run your pipeline using a Microsoft®-hosted or self-hosted agent. For more information, see the extension on Visual Studio Marketplace.
Bamboo
To perform continuous integration with MATLAB on Bamboo®, install a plugin on your Bamboo CI server. The plugin provides you with tasks to run a MATLAB build, as well as MATLAB tests, scripts, functions, and statements as part of your build. For more information, see Continuous Integration with MATLAB on Bamboo.
CircleCI
To perform continuous integration with MATLAB on CircleCI, opt-in to using third-party orbs in your organization security
settings. To run MATLAB in your pipeline, import the appropriate orb to author your pipeline
in a file named .circleci/config.yml
in the root of your
repository. For more information, see the orb on
CircleCI Orb Registry.
GitHub Actions
To perform continuous integration with MATLAB on GitHub® Actions, make sure GitHub Actions is enabled for your repository. To run MATLAB in your workflow, use the appropriate actions when you define your
workflow in the .github/workflows
directory of your repository.
You can run your workflow using a GitHub-hosted or self-hosted runner. For more information, see Use MATLAB with GitHub
Actions.
GitLab CI/CD
To perform continuous integration with MATLAB on GitLab® CI/CD, use a template to author your pipeline in a file named
.gitlab-ci.yml
in the root of your repository. The template
provides you with jobs to run a MATLAB build, as well as MATLAB tests, scripts, functions, and statements as part of your build. For
more information, see Use MATLAB with GitLab CI/CD.
Jenkins
To perform continuous integration with MATLAB on Jenkins, install a plugin on your Jenkins agent. Then, you can use an interface to run MATLAB in freestyle and multi-configuration (matrix) projects. You also can configure your pipeline as code checked into source control. For more information, see the plugin on Jenkins Plugins Index.
TeamCity
To perform continuous integration with MATLAB on TeamCity®, install a plugin on your TeamCity server. The plugin provides you with build steps to run a MATLAB build, as well as MATLAB tests, scripts, functions, and statements as part of your build. For more information, see Continuous Integration with MATLAB on TeamCity.
Other Platforms
To perform continuous integration with MATLAB on other CI platforms, use the matlab
command with the
-batch
option in your pipeline. You can use matlab
-batch
to run MATLAB scripts, functions, and statements noninteractively. For example,
matlab -batch "myscript"
starts MATLAB noninteractively and runs the commands in a file named
myscript.m
. MATLAB terminates automatically with exit code 0 if the specified script,
function, or statement executes successfully without error. Otherwise, MATLAB terminates with a nonzero exit code.
See Also
Functions
Namespaces
Related Topics
- Develop and Integrate Software with Continuous Integration
- Generate Artifacts Using MATLAB Unit Test Plugins