-
Notifications
You must be signed in to change notification settings - Fork 92
665 lines (553 loc) · 25.6 KB
/
simple_per_test.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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
###############################################################################
#
# Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
# Analog Devices, Inc.),
# Copyright (C) 2023-2024 Analog Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
name: simple_per_test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Control when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
# push:
# branches: ["main"]
# pull_request:
# branches: ["main"]
# types: [opened, reopened, synchronize, ready_for_review]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
simple_per_test_on_all_boards:
# The type of runner that the job will run on
runs-on: [self-hosted, btm-ci]
if: github.event.pull_request.draft == false
steps:
# Checks-out repository under $GITHUB_WORKSPACE so that each job can access it
- uses: actions/checkout@v3
with:
submodules: false
repository: analogdevicesinc/msdk
ref: main
- name: clean
run: |
# Clean up the working copy
git scorch
# Remove old archives
rm -f *.zip
# Runs a set of commands using the runners shell
- name: get_and_set_configurations
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
#------------------------------------------------
# Get the configuration
CONFIG_FILE=/home/$USER/Workspace/ci_config/msdk.json
NO_SKIP=`python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['no_skip'])"`
echo "::set-env name=NO_SKIP::${NO_SKIP}"
echo "NO_SKIP: ${NO_SKIP}"
echo ""
COMMIT_ID=`python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['commit_id'])"`
echo "::set-env name=COMMIT_ID::${COMMIT_ID}"
echo "COMMIT_ID: ${COMMIT_ID}"
echo ""
START_TIME=`python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['start_time'])"`
echo "::set-env name=START_TIME::${START_TIME}"
echo "START_TIME: ${START_TIME}"
echo ""
LIMIT=`python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['limit'])"`
echo "::set-env name=LIMIT::${LIMIT}"
echo "LIMIT: ${LIMIT}"
echo ""
DO_MAX32655=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['do_max32655'])")
DO_MAX32665=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['do_max32665'])")
DO_MAX32690=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['do_max32690'])")
DO_MAX32690_WLP=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['do_max32690_wlp'])")
echo "::set-env name=DO_MAX32655::${DO_MAX32655}"
echo "::set-env name=DO_MAX32665::${DO_MAX32665}"
echo "::set-env name=DO_MAX32690::${DO_MAX32690}"
echo "::set-env name=DO_MAX32690_WLP::${DO_MAX32690_WLP}"
echo DO_MAX32655: ${DO_MAX32655}
echo DO_MAX32665: ${DO_MAX32665}
echo DO_MAX32690: ${DO_MAX32690}
echo DO_MAX32690_WLP: ${DO_MAX32690_WLP}
echo ""
MAX32655_PKG_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32655_pkglen_range'])")
MAX32665_PKG_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32665_pkglen_range'])")
MAX32690_PKG_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_pkglen_range'])")
MAX32690_WLP_PKG_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_wlp_pkglen_range'])")
echo "::set-env name=MAX32655_PKG_RA::${MAX32655_PKG_RA}"
echo "::set-env name=MAX32665_PKG_RA::${MAX32665_PKG_RA}"
echo "::set-env name=MAX32690_PKG_RA::${MAX32690_PKG_RA}"
echo "::set-env name=MAX32690_WLP_PKG_RA::${MAX32690_WLP_PKG_RA}"
echo MAX32655_PKG_RA: ${MAX32655_PKG_RA}
echo MAX32665_PKG_RA: ${MAX32665_PKG_RA}
echo MAX32690_PKG_RA: ${MAX32690_PKG_RA}
echo MAX32690_WLP_PKG_RA: ${MAX32690_WLP_PKG_RA}
echo
export MAX32655_PHY_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32655_phy_range'])")
export MAX32665_PHY_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32665_phy_range'])")
export MAX32690_PHY_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_phy_range'])")
export MAX32690_WLP_PHY_RA=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_wlp_phy_range'])")
echo "::set-env name=MAX32655_PHY_RA::${MAX32655_PHY_RA}"
echo "::set-env name=MAX32665_PHY_RA::${MAX32665_PHY_RA}"
echo "::set-env name=MAX32690_PHY_RA::${MAX32690_PHY_RA}"
echo "::set-env name=MAX32690_WLP_PHY_RA::${MAX32690_WLP_PHY_RA}"
echo MAX32655_PHY_RA: ${MAX32655_PHY_RA}
echo MAX32665_PHY_RA: ${MAX32665_PHY_RA}
echo MAX32690_PHY_RA: ${MAX32690_PHY_RA}
echo MAX32690_WLP_PHY_RA: ${MAX32690_WLP_PHY_RA}
echo
MAX32655_ATTENS=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32655_attens'])")
MAX32665_ATTENS=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32665_attens'])")
MAX32690_ATTENS=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_attens'])")
MAX32690_WLP_ATTENS=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_attens'])")
echo "::set-env name=MAX32655_ATTENS::${MAX32655_ATTENS}"
echo "::set-env name=MAX32665_ATTENS::${MAX32665_ATTENS}"
echo "::set-env name=MAX32690_ATTENS::${MAX32690_ATTENS}"
echo "::set-env name=MAX32690_ATTENS::${MAX32690_WLP_ATTENS}"
echo MAX32655_ATTENS: ${MAX32655_ATTENS}
echo MAX32665_ATTENS: ${MAX32665_ATTENS}
echo MAX32690_ATTENS: ${MAX32690_ATTENS}
echo MAX32690_WLP_ATTENS: ${MAX32690_WLP_ATTENS}
echo
MAX32655_STEP=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32655_step'])")
MAX32665_STEP=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32665_step'])")
MAX32690_STEP=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_step'])")
MAX32690_WLP_STEP=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['max32690_wlp_step'])")
echo "::set-env name=MAX32655_STEP::${MAX32655_STEP}"
echo "::set-env name=MAX32665_STEP::${MAX32665_STEP}"
echo "::set-env name=MAX32690_STEP::${MAX32690_STEP}"
echo "::set-env name=MAX32690_WLP_STEP::${MAX32690_WLP_STEP}"
echo MAX32655_STEP: ${MAX32655_STEP}
echo MAX32665_STEP: ${MAX32665_STEP}
echo MAX32690_STEP: ${MAX32690_STEP}
echo MAX32690_WLP_STEP: ${MAX32690_WLP_STEP}
echo
JOB_CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
echo "::set-env name=JOB_CURR_TIME::${JOB_CURR_TIME}"
echo JOB_CURR_TIME: ${JOB_CURR_TIME}
echo
RETRY=$(python3 -c "import json; import os; obj=json.load(open('${CONFIG_FILE}')); print(obj['tests']['simple_per_test.yml']['retry_limit'])")
echo "::set-env name=RETRY::${RETRY}"
echo RETRY: ${RETRY}
echo
MSDK=${GITHUB_WORKSPACE}
echo "::set-env name=MSDK::${MSDK}"
echo MSDK: ${MSDK}
echo
# Runs a set of commands using the runners shell
- name: max32655_simple_per_test
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
#------------------------------------------------------------------------------------------------------------
# Prepare the arguments for script.
CHIP_UC=MAX32655
BRD_TYPE=EvKit_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
exit 0
fi
#------------------------------------------------
# Prepare the arguments for function call
if [ "${DO_MAX32655}" == "0" ]; then
echo "Skip the test for MAX32655."
exit 0
fi
BRD2_CHIP_LC=max32655
MSDK=${GITHUB_WORKSPACE}
host_name=`hostname`
if [ "$host_name" == "wall-e" ]; then
BRD1=nRF52840_1
BRD2=max32655_board_2
else
BRD1=nRF52840_2
BRD2=max32655_board_y1
fi
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
echo "all_in_one: ${all_in_one}"
echo
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
$BRD2 \
$CURR_TIME \
$(realpath ${CURR_JOB_FILE}) \
$(realpath ${CURR_LOG}) \
$(realpath ${all_in_one}) \
"${MAX32655_PKG_RA}" \
"${MAX32655_PHY_RA}" \
${MAX32655_STEP} \
${LIMIT} \
${RETRY} \
"${MAX32655_ATTENS}" \
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
echo "${CHIP_UC} ${BRD2_TYPE} FAILED!"
#core.setFailed("PER test failed.")
exit 1
fi
#------------------------------------------------
# Unlock even when cancelled or failed
- name: unlock_max32655
if: always()
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
cd ${GITHUB_WORKSPACE}
echo PWD: `pwd`
echo
chmod u+x ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh
echo ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} "${CURR_JOB_FILE}" "${all_in_one}" True ${JOB_CURR_TIME} 2>&1 | tee -a ${CURR_LOG}
${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} "${CURR_JOB_FILE}" "${all_in_one}" True ${JOB_CURR_TIME} 2>&1 | tee -a ${CURR_LOG}
echo "Add files to per.zip"
if [ -f ${all_in_one} ]; then
echo "Add ${all_in_one}"
if [[ `wc -c ${all_in_one} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${all_in_one}
else
echo "Empty file."
fi
fi
echo
if [ -f ${CURR_LOG} ]; then
echo "Add ${CURR_LOG}"
if [[ `wc -c ${CURR_LOG} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${CURR_LOG}
else
echo "Empty file."
fi
fi
echo "::set-env name=all_in_one::"
echo "::set-env name=CURR_JOB_FILE::"
# Runs a set of commands using the runners shell
- name: max32665_simple_per_test
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
#------------------------------------------------------------------------------------------------------------
# Prepare the arguments for script.
CHIP_UC=MAX32665
BRD_TYPE=EvKit_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
exit 0
fi
#------------------------------------------------
# Prepare the arguments for function call
if [ "${DO_MAX32665}" == "0" ]; then
echo "Skip the test for MAX32665."
exit 0
fi
BRD2_CHIP_LC=max32665
MSDK=${GITHUB_WORKSPACE}
BRD1=nRF52840_1
BRD2=max32665_board_w3
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
$BRD2 \
$CURR_TIME \
$(realpath ${CURR_JOB_FILE}) \
$(realpath ${CURR_LOG}) \
$(realpath ${all_in_one}) \
"${MAX32665_PKG_RA}" \
"${MAX32665_PHY_RA}" \
${MAX32665_STEP} \
${LIMIT} \
${RETRY} \
"${MAX32665_ATTENS}" \
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
echo "${CHIP_UC} ${BRD2_TYPE} FAILED!"
#core.setFailed("PER test failed.")
exit 1
fi
#------------------------------------------------
# Unlock even when cancelled or failed
- name: unlock_max32665
if: always()
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
cd ${GITHUB_WORKSPACE}
echo PWD: `pwd`
echo
chmod u+x ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh
${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} "${CURR_JOB_FILE}" "${all_in_one}" True ${JOB_CURR_TIME} 2>&1 | tee -a ${CURR_LOG}
echo "Add files to per.zip"
if [ -f ${all_in_one} ]; then
echo "Add ${all_in_one}"
if [[ `wc -c ${all_in_one} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${all_in_one}
else
echo "Empty file."
fi
fi
echo
if [ -f ${CURR_LOG} ]; then
echo "Add ${CURR_LOG}"
if [[ `wc -c ${CURR_LOG} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${CURR_LOG}
else
echo "Empty file."
fi
fi
echo "::set-env name=all_in_one::"
echo "::set-env name=CURR_JOB_FILE::"
# Runs a set of commands using the runners shell
- name: max32690_simple_per_test
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
#------------------------------------------------------------------------------------------------------------
# Prepare the arguments for script.
CHIP_UC=MAX32690
BRD_TYPE=EvKit_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
exit 0
fi
#------------------------------------------------
# Prepare the arguments for function call
if [ "${DO_MAX32690}" == "0" ]; then
echo "Skip the test for MAX32690."
exit 0
fi
BRD2_CHIP_LC=max32690
MSDK=${GITHUB_WORKSPACE}
BRD1=nRF52840_1
BRD2=max32690_board_w2
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
$BRD2 \
$CURR_TIME \
$(realpath ${CURR_JOB_FILE}) \
$(realpath ${CURR_LOG}) \
$(realpath ${all_in_one}) \
"${MAX32690_PKG_RA}" \
"${MAX32690_PHY_RA}" \
${MAX32690_STEP} \
${LIMIT} \
${RETRY} \
"${MAX32690_ATTENS}" \
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
echo "${CHIP_UC} ${BRD2_TYPE} FAILED!"
#core.setFailed("PER test failed.")
exit 1
fi
#------------------------------------------------
# Unlock even when cancelled or failed
- name: unlock_max32690
if: always()
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
cd ${GITHUB_WORKSPACE}
echo PWD: `pwd`
echo
chmod u+x ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh
${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} "${CURR_JOB_FILE}" "${all_in_one}" True ${JOB_CURR_TIME} 2>&1 | tee -a ${CURR_LOG}
echo "Add files to per.zip"
if [ -f ${all_in_one} ]; then
echo "Add ${all_in_one}"
if [[ `wc -c ${all_in_one} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${all_in_one}
else
echo "Empty file."
fi
fi
echo
if [ -f ${CURR_LOG} ]; then
echo "Add ${CURR_LOG}"
if [[ `wc -c ${CURR_LOG} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${CURR_LOG}
else
echo "Empty file."
fi
fi
echo "::set-env name=all_in_one::"
echo "::set-env name=CURR_JOB_FILE::"
# Runs a set of commands using the runners shell
- name: max32690-wlp_simple_per_test
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
#------------------------------------------------------------------------------------------------------------
# Prepare the arguments for script.
CHIP_UC=MAX32690
BRD_TYPE=WLP_V1
$MSDK/.github/workflows/scripts/msdk_per_skip_check.sh \
$NO_SKIP \
$MSDK \
$CHIP_UC \
$BRD_TYPE
if [[ $? -ne 0 ]]; then
echo "SKIPPED."
exit 0
fi
#------------------------------------------------
# Prepare the arguments for function call
if [ "${DO_MAX32690_WLP}" == "0" ]; then
echo "Skip the test for MAX32690 WLP_V1."
exit 0
fi
BRD2_CHIP_LC=max32690
MSDK=${GITHUB_WORKSPACE}
BRD1=nRF52840_1
BRD2=max32690_board_A1
CURR_TIME=$(date +%Y-%m-%d_%H-%M-%S)
CURR_JOB_FILE=/home/$USER/Workspace/Resource_Share/History/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.txt
echo "::set-env name=CURR_JOB_FILE::${CURR_JOB_FILE}"
CURR_LOG=/home/$USER/Workspace/Resource_Share/Logs/msdk_simple_per_test_${CURR_TIME}_${BRD2_CHIP_LC}_${BRD_TYPE}.log
echo "::set-env name=CURR_LOG::${CURR_LOG}"
RESULT_PATH=~/Workspace/ci_results/per
res=${RESULT_PATH}/msdk-${CURR_TIME}
all_in_one=${res}_${BRD2_CHIP_LC}_${BRD_TYPE}.csv
echo "::set-env name=all_in_one::${all_in_one}"
#------------------------------------------------
set -e
${MSDK}/.github/workflows/scripts/board_per_test.sh \
$MSDK \
$BRD1 \
$BRD2 \
$CURR_TIME \
$(realpath ${CURR_JOB_FILE}) \
$(realpath ${CURR_LOG}) \
$(realpath ${all_in_one}) \
"${MAX32690_WLP_PKG_RA}" \
"${MAX32690_WLP_PHY_RA}" \
${MAX32690_WLP_STEP} \
${LIMIT} \
${RETRY} \
"${MAX32690_WLP_ATTENS}" \
2>&1 | tee -a ${CURR_LOG}
if [[ $? -ne 0 ]]; then
echo "${CHIP_UC} ${BRD2_TYPE} FAILED!"
#core.setFailed("PER test failed.")
exit 1
fi
#------------------------------------------------
# Unlock even when cancelled or failed
- name: unlock_max32690-wlp
if: always()
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
cd ${GITHUB_WORKSPACE}
echo PWD: `pwd`
echo
chmod u+x ${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh
${GITHUB_WORKSPACE}/.github/workflows/scripts/unlock_plot.sh ${GITHUB_WORKSPACE} "${CURR_JOB_FILE}" "${all_in_one}" True ${JOB_CURR_TIME} 2>&1 | tee -a ${CURR_LOG}
echo "Add files to per.zip"
if [ -f ${all_in_one} ]; then
echo "Add ${all_in_one}"
if [[ `wc -c ${all_in_one} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${all_in_one}
else
echo "Empty file."
fi
fi
echo
if [ -f ${CURR_LOG} ]; then
echo "Add ${CURR_LOG}"
if [[ `wc -c ${CURR_LOG} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${CURR_LOG}
else
echo "Empty file."
fi
fi
echo "::set-env name=all_in_one::"
echo "::set-env name=CURR_JOB_FILE::"
- name: show_results
if: always()
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
run: |
# add all results to per.zip
result_files=/tmp/msdk/ci/per/${JOB_CURR_TIME}_zip_list.txt
if [ -f $result_files ]; then
while IFS= read -r line; do
#echo $line
if [[ `wc -c ${line} | awk '{print $1}'` -gt 0 ]]; then
zip ${MSDK}/per.zip ${line}
fi
done <$result_files
fi
# show ULRs
url_file=/tmp/msdk/ci/per/${JOB_CURR_TIME}.url
echo "URLs are saved in file: $url_file"
echo ""
if [ -f $url_file ]; then
cat $url_file
fi
- name: "Upload Artifact"
uses: actions/upload-artifact@v3
with:
name: simple_per_results
path: per.zip