-
Notifications
You must be signed in to change notification settings - Fork 12
66 lines (57 loc) · 2.14 KB
/
bat.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
name: Build and Test
on: [push]
jobs:
bat:
name: Build and Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Perform npm tasks
run: npm run ci
- name: Perform 'setup-matlab'
uses: matlab-actions/setup-matlab@v2
with:
products: |
Simulink
Simulink_Test
Simulink_Coverage
- name: Run MATLAB Tests
uses: ./
with:
source-folder: sample
startup-options: -logfile output.log
- name: Verify option application
run: |
set -e
grep "Running TheTruth" output.log
grep "Done TheTruth" output.log
grep "1 Passed" output.log
- name: Generate Model
uses: matlab-actions/run-command@v2
with:
command: cd('sample'),createSampleModel('temp_model'),sltest.testmanager.createTestsFromModel('sltestfile', 'temp_model');
- name: Set up diary for logging
run: echo 'diary console.log' >> startup.m
- name: Run run-test command
uses: ./
with:
test-results-simulink-test: test-results/simulinktest.mldatx
model-coverage-cobertura: test-results/modelcoverage.xml
test-results-pdf: test-results/pdf-results.pdf
select-by-folder: sample
strict: true
use-parallel: true
output-detail: Detailed
logging-level: Detailed
- name: Verify artifacts generation
run: |
(test -f test-results/simulinktest.mldatx) || (echo "File simulinktest.mldatx does not exist" && exit 1)
(test -f test-results/modelcoverage.xml) || (echo "File modelcoverage.xml does not exist" && exit 1)
(test -f test-results/pdf-results.pdf) || (echo "File pdf-results.pdf does not exist" && exit 1)
grep -q "runner.addPlugin(FailOnWarningsPlugin())" console.log
grep -q "runInParallel" console.log
grep -q "'OutputDetail', 3" console.log
grep -q "'LoggingLevel', 3" console.log