|
| 1 | +stages: |
| 2 | +# Set up two testing paths |
| 3 | + - setup |
| 4 | + - test |
| 5 | + - release |
| 6 | + |
| 7 | +setup-job: |
| 8 | + tags: |
| 9 | + - matlab |
| 10 | + stage: setup |
| 11 | + script: |
| 12 | + - cd .. |
| 13 | + - if (test-path utilities) { rm -r -force utilities } |
| 14 | + - git clone git@insidelabs-git.mathworks.com:modular-curriculum-content/utilities.git |
| 15 | + - cd $CI_PROJECT_NAME |
| 16 | + allow_failure: false |
| 17 | + |
| 18 | + |
| 19 | +smoke-test: |
| 20 | +# Smoke tests should run all the time |
| 21 | + tags: |
| 22 | + # Add additional tags like (e.g. - arduino) as required |
| 23 | + # Make sure that the runner you plan to use matches the tags |
| 24 | + - matlab |
| 25 | + stage: test |
| 26 | + script: |
| 27 | + - matlab -batch "openProject(pwd); |
| 28 | + results = runtests(fullfile('SoftwareTests','SmokeTests.m')); |
| 29 | + disp(table(results)); assertSuccess(results);" |
| 30 | + when: always |
| 31 | + allow_failure: true |
| 32 | + |
| 33 | +smoke-test-solution: |
| 34 | + tags: |
| 35 | + - matlab |
| 36 | + stage: release |
| 37 | + script: |
| 38 | + - matlab -batch "proj = openProject(pwd); |
| 39 | + addpath(genpath(proj.RootFolder)); |
| 40 | + results = runtests(fullfile('InternalFiles','Tests','CI','SolnSmokeTests.m')); |
| 41 | + disp(table(results)); assertSuccess(results);" |
| 42 | + rules: |
| 43 | +# This test should always run when merging to main |
| 44 | +# And be available for manual running on any push |
| 45 | + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH |
| 46 | + when: always |
| 47 | + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH |
| 48 | + when: manual |
| 49 | + allow_failure: true |
| 50 | + |
| 51 | +file-test: |
| 52 | + tags: |
| 53 | + - matlab |
| 54 | + stage: release |
| 55 | + script: |
| 56 | + - matlab -batch "proj = openProject(pwd); |
| 57 | + addpath(proj.RootFolder+'/InternalFiles/Tests/CI'); |
| 58 | + results = runtests('OpenCloseFileTest.m'); |
| 59 | + disp(table(results)); assertSuccess(results);" |
| 60 | + rules: |
| 61 | +# This test should always run when merging to main |
| 62 | +# And be available for manual running on any push |
| 63 | + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH |
| 64 | + when: always |
| 65 | + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH |
| 66 | + when: manual |
| 67 | + allow_failure: true |
| 68 | + |
| 69 | +release-testing: |
| 70 | + tags: |
| 71 | + - matlab |
| 72 | + stage: release |
| 73 | + script: |
| 74 | + - matlab -batch "proj = openProject(pwd); |
| 75 | + cd ..; |
| 76 | + addpath(genpath(fullfile('utilities','TestingResources'))); |
| 77 | + runCMTests" |
| 78 | + rules: |
| 79 | +# This test should always run when merging to main |
| 80 | +# And be available for manual running on any push |
| 81 | + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH |
| 82 | + when: always |
| 83 | + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH |
| 84 | + when: manual |
| 85 | + allow_failure: true |
0 commit comments