Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
892c2fc2
Commit
892c2fc2
authored
Apr 13, 2022
by
Marcel Amirault
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'matlab-template' into 'master'
New MATLAB CI template See merge request gitlab-org/gitlab!82914
parents
e5ec3f26
a42830f8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
178 additions
and
0 deletions
+178
-0
config/metrics/counts_28d/20210216184559_ci_templates_total_unique_counts_monthly.yml
...210216184559_ci_templates_total_unique_counts_monthly.yml
+1
-0
config/metrics/counts_28d/20220310184327_p_ci_templates_matlab_monthly.yml
...unts_28d/20220310184327_p_ci_templates_matlab_monthly.yml
+25
-0
config/metrics/counts_7d/20210216184557_ci_templates_total_unique_counts_weekly.yml
...0210216184557_ci_templates_total_unique_counts_weekly.yml
+1
-0
config/metrics/counts_7d/20220310184320_p_ci_templates_matlab_weekly.yml
...counts_7d/20220310184320_p_ci_templates_matlab_weekly.yml
+25
-0
lib/gitlab/ci/templates/MATLAB.gitlab-ci.yml
lib/gitlab/ci/templates/MATLAB.gitlab-ci.yml
+96
-0
lib/gitlab/usage_data_counters/known_events/ci_templates.yml
lib/gitlab/usage_data_counters/known_events/ci_templates.yml
+4
-0
spec/lib/gitlab/ci/templates/MATLAB_spec.rb
spec/lib/gitlab/ci/templates/MATLAB_spec.rb
+26
-0
No files found.
config/metrics/counts_28d/20210216184559_ci_templates_total_unique_counts_monthly.yml
100644 → 100755
View file @
892c2fc2
...
...
@@ -168,6 +168,7 @@ options:
-
p_ci_templates_kaniko
-
p_ci_templates_qualys_iac_security
-
p_ci_templates_liquibase
-
p_ci_templates_matlab
distribution
:
-
ce
-
ee
...
...
config/metrics/counts_28d/20220310184327_p_ci_templates_matlab_monthly.yml
0 → 100644
View file @
892c2fc2
---
key_path
:
redis_hll_counters.ci_templates.p_ci_templates_matlab_monthly
description
:
"
"
product_section
:
"
"
product_stage
:
"
"
product_group
:
"
"
product_category
:
"
"
value_type
:
number
status
:
active
milestone
:
"
14.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82914
time_frame
:
28d
data_source
:
redis_hll
data_category
:
optional
instrumentation_class
:
RedisHLLMetric
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
options
:
events
:
-
p_ci_templates_matlab
config/metrics/counts_7d/20210216184557_ci_templates_total_unique_counts_weekly.yml
100644 → 100755
View file @
892c2fc2
...
...
@@ -168,6 +168,7 @@ options:
-
p_ci_templates_kaniko
-
p_ci_templates_qualys_iac_security
-
p_ci_templates_liquibase
-
p_ci_templates_matlab
distribution
:
-
ce
-
ee
...
...
config/metrics/counts_7d/20220310184320_p_ci_templates_matlab_weekly.yml
0 → 100644
View file @
892c2fc2
---
key_path
:
redis_hll_counters.ci_templates.p_ci_templates_matlab_weekly
description
:
"
"
product_section
:
"
"
product_stage
:
"
"
product_group
:
"
"
product_category
:
"
"
value_type
:
number
status
:
active
milestone
:
"
14.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82914
time_frame
:
7d
data_source
:
redis_hll
data_category
:
optional
instrumentation_class
:
RedisHLLMetric
distribution
:
-
ce
-
ee
tier
:
-
free
-
premium
-
ultimate
options
:
events
:
-
p_ci_templates_matlab
lib/gitlab/ci/templates/MATLAB.gitlab-ci.yml
0 → 100644
View file @
892c2fc2
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/MATLAB.gitlab-ci.yml
# Use this template to run MATLAB and Simulink as part of your CI/CD pipeline. The template has three jobs:
# - `command`: Run MATLAB scripts, functions, and statements.
# - `test`: Run tests authored using the MATLAB unit testing framework or Simulink Test.
# - `test_artifacts_job`: Run MATLAB and Simulink tests, and generate test and coverage artifacts.
#
# You can copy and paste one or more jobs in this template into your `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# - To run MATLAB and Simulink, MATLAB must be installed on the runner that will run the jobs.
# The runner will use the topmost MATLAB version on the system path.
# The build fails if the operating system cannot find MATLAB on the path.
# - The jobs in this template use the `matlab -batch` syntax to start MATLAB. The `-batch` option is supported
# in MATLAB R2019a and later.
# The `command` runs MATLAB scripts, functions, and statements. To use the job in your pipeline,
# substitute `command` with the code you want to run.
#
command
:
script
:
matlab -batch command
# If the value of `command` is the name of a MATLAB script or function, do not specify the file extension.
# For example, to run a script named `myscript.m` in the root of your repository, specify the `command` like this:
#
# "myscript"
#
# If you specify more than one script, function, or statement, use a comma or semicolon to separate them.
# For example, to run `myscript.m` in a folder named `myfolder` located in the root of the repository,
# you can specify the `command` like this:
#
# "addpath('myfolder'), myscript"
#
# MATLAB exits with exit code 0 if the specified script, function, or statement executes successfully without
# error. Otherwise, MATLAB terminates with a nonzero exit code, which causes the job to fail. To have the
# job fail in certain conditions, use the [`assert`][1] or [`error`][2] functions.
#
# [1] https://www.mathworks.com/help/matlab/ref/assert.html
# [2] https://www.mathworks.com/help/matlab/ref/error.html
# The `test` runs the MATLAB and Simulink tests in your project. It calls the [`runtests`][3] function
# to run the tests and then the [`assertSuccess`][4] method to fail the job if any of the tests fail.
#
test
:
script
:
matlab -batch "results = runtests('IncludeSubfolders',true), assertSuccess(results);"
# By default, the job includes any files in your [MATLAB Project][5] that have a `Test` label. If your repository
# does not have a MATLAB project, then the job includes all tests in the root of your repository or in any of
# its subfolders.
#
# [3] https://www.mathworks.com/help/matlab/ref/runtests.html
# [4] https://www.mathworks.com/help/matlab/ref/matlab.unittest.testresult.assertsuccess.html
# [5] https://www.mathworks.com/help/matlab/projects.html
# The `test_artifacts_job` runs your tests and additionally generates test and coverage artifacts.
# It uses the plugin classes in the [`matlab.unittest.plugins`][6] package to generate a JUnit test results
# report and a Cobertura code coverage report. Like the `run_tests` job, this job runs all the tests in your
# project and fails the build if any of the tests fail.
#
test_artifacts_job
:
script
:
|
matlab -batch "
import matlab.unittest.TestRunner
import matlab.unittest.Verbosity
import matlab.unittest.plugins.CodeCoveragePlugin
import matlab.unittest.plugins.XMLPlugin
import matlab.unittest.plugins.codecoverage.CoberturaFormat
suite = testsuite(pwd,'IncludeSubfolders',true);
[~,~] = mkdir('artifacts');
runner = TestRunner.withTextOutput('OutputDetail',Verbosity.Detailed);
runner.addPlugin(XMLPlugin.producingJUnitFormat('artifacts/results.xml'))
runner.addPlugin(CodeCoveragePlugin.forFolder(pwd,'IncludingSubfolders',true, ...
'Producing',CoberturaFormat('artifacts/cobertura.xml')))
results = runner.run(suite)
assertSuccess(results);"
artifacts
:
reports
:
junit
:
"
./artifacts/results.xml"
cobertura
:
"
./artifacts/cobertura.xml"
paths
:
-
"
./artifacts"
# You can modify the contents of the `test_artifacts_job` depending on your goals. For more
# information on how to customize the test runner and generate various test and coverage artifacts,
# see [Generate Artifacts Using MATLAB Unit Test Plugins][7].
#
# [6] https://www.mathworks.com/help/matlab/ref/matlab.unittest.plugins-package.html
# [7] https://www.mathworks.com/help/matlab/matlab_prog/generate-artifacts-using-matlab-unit-test-plugins.html
lib/gitlab/usage_data_counters/known_events/ci_templates.yml
View file @
892c2fc2
...
...
@@ -619,3 +619,7 @@
category
:
ci_templates
redis_slot
:
ci_templates
aggregation
:
weekly
-
name
:
p_ci_templates_matlab
category
:
ci_templates
redis_slot
:
ci_templates
aggregation
:
weekly
spec/lib/gitlab/ci/templates/MATLAB_spec.rb
0 → 100644
View file @
892c2fc2
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'MATLAB.gitlab-ci.yml'
do
subject
(
:template
)
{
Gitlab
::
Template
::
GitlabCiYmlTemplate
.
find
(
'MATLAB'
)
}
describe
'the created pipeline'
do
let_it_be
(
:project
)
{
create
(
:project
,
:auto_devops
,
:custom_repo
,
files:
{
'README.md'
=>
''
})
}
let
(
:user
)
{
project
.
first_owner
}
let
(
:default_branch
)
{
'master'
}
let
(
:pipeline_branch
)
{
default_branch
}
let
(
:service
)
{
Ci
::
CreatePipelineService
.
new
(
project
,
user
,
ref:
pipeline_branch
)
}
let
(
:pipeline
)
{
service
.
execute!
(
:push
).
payload
}
let
(
:build_names
)
{
pipeline
.
builds
.
pluck
(
:name
)
}
before
do
stub_ci_pipeline_yaml_file
(
template
.
content
)
end
it
'creates all jobs'
do
expect
(
build_names
).
to
include
(
'command'
,
'test'
,
'test_artifacts_job'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment