Main Content

Locally Reproduce Issues Found in CI

With the CI/CD Automation for Simulink Check support package, you can run your process in CI, download the job artifacts, and locally view the results in Process Advisor. If there were failures in CI, you can use Process Advisor to debug and find issues in your artifacts that you need to fix on your local machine. You can copy results from CI jobs onto your local machine by cloning a copy of the project that you ran in CI and copying the latest job artifacts.

For information about how to run your process in CI, see Integrate Process into CI.

Get Latest Project Files

  1. In MATLAB®, get the latest project files by cloning a copy of the project onto your local machine. For more information, see Clone Git Repository.

  2. Close your local copy of the project. You must close the project before you attempt to copy CI artifacts into the project folder.

Download and Copy CI Artifacts into Project

  1. In your CI system, open the job that you want to inspect locally and download the artifacts that the job generated. Job artifacts typically download as a ZIP file.

    If you are using the pipeline generator, padv.pipeline.generatePipeline, the Collect_Artifacts job automatically collects and compresses the build artifacts from your pipeline into a ZIP file that you can download.

  2. Close your local copy of the project if you have it open in MATLAB.

  3. Extract the files from the ZIP file and copy the artifacts into the folder for your local copy of the project. The copied artifacts do not need to be added to the MATLAB path or project path.

  4. Open your local copy of the project in MATLAB.

  5. Open the Process Advisor app. If you see a warning banner, click Refresh Tasks.

Debug in Process Advisor

After you refresh the tasks, you can use Process Advisor to:

  • See the task results from the CI job in your local Process Advisor app

  • Re-run tasks locally to reproduce the CI failure on your local machine

  • Make changes to your project to fix the issues observed in CI

  • Re-run tasks locally to confirm that you resolve open issues before submitting to source control

For more information, see Automate and Run Tasks with Process Advisor

Considerations for Parallel Code Generation

Starting in R2023b Update 5, the pipeline generator supports a round-trip, parallel CI workflow that automatically merges the task statuses and project analysis from across the parallel branches. For information, see Parallel Pipeline Architectures.

If you are using the pipeline generator in a previous release and you specify a parallel pipeline architecture like IndependentModelPipeline, each parallel pipeline generates separate artifact database files, artifacts.dmr, for each parallel branch. The build system and Process Advisor app can only load one artifacts.dmr file at a time, so if you try to view the generated task statuses and results on your local machine, you see incomplete or outdated task statuses.

Related Topics