-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (159 loc) · 5.13 KB
/
Copy pathmatlab-tests.yml
File metadata and controls
183 lines (159 loc) · 5.13 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: MATLAB Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '17 10 * * 1'
env:
MATLAB_RELEASE: R2025a
concurrency:
group: matlab-tests-${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.sha }}
cancel-in-progress: true
jobs:
headless:
name: Headless Tests
runs-on: ubuntu-latest
timeout-minutes: 25
env:
MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }}
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v3
with:
release: ${{ env.MATLAB_RELEASE }}
- name: Prepare artifact directories
run: mkdir -p artifacts/logs/headless
- name: Run headless tests
uses: matlab-actions/run-build@v3
with:
tasks: headless
startup-options: -logfile artifacts/logs/headless/matlab.log
- name: Summarize headless tests
if: always()
run: |
found=0
for junit in artifacts/test-results/*/junit.xml; do
[ -f "$junit" ] || continue
found=1
run_name="$(basename "$(dirname "$junit")")"
log_path="artifacts/logs/${run_name}/matlab.log"
if [ ! -f "$log_path" ] && [ -f "artifacts/logs/headless-orchestrator/${run_name}.log" ]; then
log_path="artifacts/logs/headless-orchestrator/${run_name}.log"
fi
python scripts/summarize_junit.py "$junit" \
--run-name "$run_name" \
--html "artifacts/test-results/${run_name}/html/index.html" \
--log "$log_path"
done
if [ "$found" -eq 0 ]; then
python scripts/summarize_junit.py artifacts/test-results/headless/junit.xml \
--run-name headless \
--html artifacts/test-results/headless/html/index.html \
--log artifacts/logs/headless/matlab.log
fi
- name: Upload headless artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: matlab-headless
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/**
artifacts/debug/**
artifacts/logs/**
coverage:
name: Coverage Report
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 35
env:
MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }}
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v3
with:
release: ${{ env.MATLAB_RELEASE }}
- name: Prepare artifact directories
run: mkdir -p artifacts/logs/coverage
- name: Run coverage report
uses: matlab-actions/run-build@v3
with:
tasks: coverage
startup-options: -logfile artifacts/logs/coverage/matlab.log
- name: Summarize coverage test results
if: always()
run: >
python scripts/summarize_junit.py
artifacts/test-results/coverage/junit.xml
--run-name coverage
--html artifacts/test-results/coverage/html/index.html
--log artifacts/logs/coverage/matlab.log
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: matlab-coverage
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/**
artifacts/coverage/**
artifacts/debug/**
artifacts/logs/**
gui:
name: GUI Tests
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 25
env:
MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }}
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v3
with:
release: ${{ env.MATLAB_RELEASE }}
- name: Prepare artifact directories
run: mkdir -p artifacts/logs/gui
- name: Run GUI tests
uses: matlab-actions/run-build@v3
with:
tasks: gui
startup-options: -logfile artifacts/logs/gui/matlab.log
- name: Summarize GUI tests
if: always()
run: >
python scripts/summarize_junit.py
artifacts/test-results/gui/junit.xml
--run-name gui
--html artifacts/test-results/gui/html/index.html
--log artifacts/logs/gui/matlab.log
- name: Upload GUI artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: matlab-gui
if-no-files-found: warn
retention-days: 14
path: |
artifacts/test-results/**
artifacts/debug/**
artifacts/gui/**
artifacts/logs/**