forked from nbhoski/test-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
57 lines (53 loc) · 1.49 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
57 lines (53 loc) · 1.49 KB
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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: InstallMATLAB@0
inputs:
release: R2020b
- task: Bash@3
inputs:
targetType: 'inline'
script: |
# Write your commands here
mkdir test
cat << EOF > 'test/tDemo.m'
classdef tDemo < matlab.unittest.TestCase
methods (Test)
function test1(testCase)
testCase.verifyEqual(testCase,5,5);
end
function test2(testCase)
testCase.verifyEqual(testCase,5,6);
end
end
end
EOF
cat << EOF > 'test/testHtml.m'
import matlab.unittest.TestRunner;
import matlab.unittest.TestSuite;
import matlab.unittest.plugins.TestReportPlugin;
suite = testsuite({'tDemo.m'});
runner = TestRunner.withNoPlugins;
htmlFolder = 'myHTMLFolder';
plugin = TestReportPlugin.producingHTML(htmlFolder);
runner.addPlugin(plugin);
result = runner.run(suite);
EOF
- task: RunMATLABCommand@0
inputs:
command: 'test/testHtml'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
- task: PublishHtmlReport@1
inputs:
reportDir: 'myHTMLFolder/index.html'