-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
85 lines (79 loc) · 2.53 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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 git@insidelabs-git.mathworks.com: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