-
Notifications
You must be signed in to change notification settings - Fork 84
741 lines (656 loc) · 32.6 KB
/
BLE_Examples_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
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
###############################################################################
#
# 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: BLE Examples Test
# Cancels workflows in progress that are in the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
pull_request:
paths-ignore:
# Any files in a docs directory anywhere in the repository.
- "**/docs/**"
- "**/Documentation/**"
# Any README.md file anywhere in the repository.
- "**/README.md"
# Any .pdf file anywhere in the repository.
- "**/*.pdf"
# Any .yml file anywhere in the repository.
# can comment this out when testing changes to THIS yml file
- "**/*.yml"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
LOCK_MAX32655_B2: false
LOCK_MAX32655_B1: false
LOCK_MAX32665_B1: false
RESULTS_DIR: "ble_test_results"
jobs:
BLE_Tests:
# The type of runner that the job will run on
runs-on: [self-hosted]
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
submodules: false
repository: analogdevicesinc/msdk
fetch-depth: 0
- name: Check MAX32655
id: MAX32655
env:
MAX32655_BLE_FILES_CHANGED: false
MAX32655_EXAMPLES_TO_TEST: ()
MAX32655_RUN_ALL_TEST: false
MAX32655_DATS_CONNECTED_TEST: false
MAX32655_OTAS_CONNECTED_TEST: false
run: |
# BLE examples to watch
declare -a watched_examples=(
# underscore in filter to ignore the BLE5_ctr examples
Examples/MAX32655/Bluetooth/BLE_*
Examples/MAX32655/Bluetooth/Bootloader
)
# Other directories to watch
declare -a watched_other=(
#To test changes this workflow push a commit with this uncommented
#.github/workflows/
.github/workflows/ci-tests/Examples_tests
Libraries/libs.mk
# Bluetooth
Libraries/BlePhy/MAX32655
Libraries/Cordio
# Board specific
Libraries/Boards/MAX32655
# Libraries
Libraries/CMSIS/Device/Maxim/MAX32655
Libraries/PeriphDrivers/libPeriphDriver.mk
Libraries/PeriphDrivers/periphdriver.mk
Libraries/PeriphDrivers/max32655_files.mk
# AES
Libraries/PeriphDrivers/Source/AES/aes_me17.c
Libraries/PeriphDrivers/Source/AES/aes_revb_regs.h
Libraries/PeriphDrivers/Source/AES/aes_revb.c
Libraries/PeriphDrivers/Source/AES/aes_revb.h
Libraries/PeriphDrivers/Source/AES/aeskeys_revb_regs.h
# Flash controller
Libraries/PeriphDrivers/Source/FLC/flc_common.c
Libraries/PeriphDrivers/Source/FLC/flc_common.h
Libraries/PeriphDrivers/Source/FLC/flc_me17.c
Libraries/PeriphDrivers/Source/FLC/flc_reva.c
Libraries/PeriphDrivers/Source/FLC/flc_reva.h
# GPIO
Libraries/PeriphDrivers/Source/GPIO/gpio_common.c
Libraries/PeriphDrivers/Source/GPIO/gpio_common.h
Libraries/PeriphDrivers/Source/GPIO/gpio_me17.c
Libraries/PeriphDrivers/Source/GPIO/gpio_reva.c
Libraries/PeriphDrivers/Source/GPIO/gpio_reva.h
# LowPower
Libraries/PeriphDrivers/Source/LP/lp_me17.c
# Simo
Libraries/PeriphDrivers/Source/SIMO/simo_me17.c
Libraries/PeriphDrivers/Source/SIMO/simo_reva_regs.h
Libraries/PeriphDrivers/Source/SIMO/simo_.c
Libraries/PeriphDrivers/Source/SIMO/simo_.h
# System
Libraries/PeriphDrivers/Source/SYS/mxc_assert.c
Libraries/PeriphDrivers/Source/SYS/mxc_delay.c
Libraries/PeriphDrivers/Source/SYS/mxc_lock.c
Libraries/PeriphDrivers/Source/SYS/mxc_table.c
Libraries/PeriphDrivers/Source/SYS/pins_me17.c
Libraries/PeriphDrivers/Source/SYS/sys_me17.c
# Timer
Libraries/PeriphDrivers/Source/TMR/tmr_common.c
Libraries/PeriphDrivers/Source/TMR/tmr_common.h
Libraries/PeriphDrivers/Source/TMR/tmr_me17.c
Libraries/PeriphDrivers/Source/TMR/tmr_revb_regs.h
Libraries/PeriphDrivers/Source/TMR/tmr_revb.c
Libraries/PeriphDrivers/Source/TMR/tmr_revb.h
# True Random Number Generator
Libraries/PeriphDrivers/Source/TRNG/trng_me17.c
Libraries/PeriphDrivers/Source/TRNG/trng_revb_regs.h
Libraries/PeriphDrivers/Source/TRNG/trng_revb.c
Libraries/PeriphDrivers/Source/TRNG/trng_revb.h
# UART
Libraries/PeriphDrivers/Source/UART/uart_common.c
Libraries/PeriphDrivers/Source/UART/uart_common.h
Libraries/PeriphDrivers/Source/UART/uart_me17.c
Libraries/PeriphDrivers/Source/UART/uart_revb_regs.h
Libraries/PeriphDrivers/Source/UART/uart_revb.c
Libraries/PeriphDrivers/Source/UART/uart_revb.h
# WakeUp Timer
Libraries/PeriphDrivers/Source/WUT/wut_me17.c
Libraries/PeriphDrivers/Source/WUT/wut_reva_regs.h
Libraries/PeriphDrivers/Source/WUT/wut_reva.c
Libraries/PeriphDrivers/Source/WUT/wut_reva_regs.h )
# Directories to ignore
declare -a ignored=(
Libraries/Cordio/docs
Documentation
)
# Create an associative array for ignored()
declare -A aignored=()
for ignore in "${ignored[@]}"; do aignored["${ignore%/}"]=1; done
# Copy the working directory list, skipping entries in ignored()
declare -a results_other=()
for watch in "${watched_other[@]}"; do test -v aignored["${watch%/}"] || results_other+=("${watch%/}"); done
# Copy the working directory list, skipping entries in ignored()
declare -a results_examples=()
for watch in "${watched_examples[@]}"; do test -v aignored["${watch%/}"] || results_examples+=("${watch%/}"); done
# Print the resulting array, separated by newlines, in sorted order
printf "\r\n-------- Watched Examples ------------\r\n\r\n"
printf '%s\n' "${results_examples[@]}" | sort
printf "\r\n-----------------------------------\r\n"
# Print the resulting array, separated by newlines, in sorted order
printf "\r\n-------- Watched Other ------------\r\n\r\n"
printf '%s\n' "${results_other[@]}" | sort
printf "\r\n-----------------------------------\r\n"
#Get the diff from main
CHANGE_FILES=$(git diff --ignore-submodules --name-only remotes/origin/main)
# Assume we want to actually run the workflow if no files changed
if [[ "$CHANGE_FILES" != "" ]]; then
# Check if ALL test are required due to 'OTHER' non BLE example directory modified
for watch_file in "${results_other[@]}"; do
if [[ "$CHANGE_FILES" == *"$watch_file"* ]]; then
MAX32655_RUN_ALL_TEST=true
echo "MAX32655_RUN_ALL_TEST=true" >> $GITHUB_ENV
echo "Enabled all tests to run because $watch_file was modified"
fi
done
# Check to see which examples have been modified to only test those
for watch_file in "${results_examples[@]}"; do
if [[ "$CHANGE_FILES" == *"$watch_file"* ]]; then
MAX32655_BLE_FILES_CHANGED=true
echo "MAX32655_BLE_FILES_CHANGED=true" >> $GITHUB_ENV
example_to_test=$(basename "$watch_file")
# Store list of examples that need to be tested
examples_list+=($example_to_test)
echo "Enabled example tests to run because $watch_file was modified"
# If dats/c or OTAC/s were modified we should also test the connected functionality
if [[ $example_to_test == "BLE_dats" ]] || [[ $example_to_test == "BLE_datc" ]]; then
MAX32655_DATS_CONNECTED_TEST=true
echo "MAX32655_DATS_CONNECTED_TEST=true" >> $GITHUB_ENV
echo "Enabled Datsc connected test"
fi
if [[ $example_to_test == "BLE_otas" ]] || [[ $example_to_test == "BLE_otac" ]]; then
MAX32655_OTAS_CONNECTED_TEST=true
echo "MAX32655_OTAS_CONNECTED_TEST=true" >> $GITHUB_ENV
echo "Enabled OTA connected test"
fi
fi
done
# Save examples list to env varaible available across steps
echo "MAX32655_EXAMPLES_TO_TEST=${examples_list[@]}" >> $GITHUB_ENV
else
# Assume we want to actually run the workflow if no files changed
MAX32655_RUN_ALL_TEST=true
echo "MAX32655_RUN_ALL_TEST=true" >> $GITHUB_ENV
echo "Assuming you want all tests to run"
fi
# Lock main board and DUT if any connected test is required otherwise just lock DUT
if [[ $MAX32655_OTAS_CONNECTED_TEST == 'true' ]] || [[ $MAX32655_DATS_CONNECTED_TEST == 'true' ]] || [[ $MAX32655_RUN_ALL_TEST == 'true' ]]; then
echo "LOCK_MAX32655_B1=true" >> $GITHUB_ENV
echo "LOCK_MAX32655_B2=true" >> $GITHUB_ENV
elif [[ $MAX32655_BLE_FILES_CHANGED == 'true' ]]; then
echo "LOCK_MAX32655_B2=true" >> $GITHUB_ENV
else
echo "no tests enabled, NOT locking anything at this step"
fi
- name: Check MAX32665
if: false
id: MAX32665
env:
MAX32665_BLE_FILES_CHANGED: false
MAX32665_EXAMPLES_TO_TEST: ()
MAX32665_RUN_ALL_TEST: false
MAX32665_DATS_CONNECTED_TEST: false
MAX32665_OTAS_CONNECTED_TEST: false
run: |
# BLE examples to watch
declare -a watched_examples=(
# underscore in filter to ignore the BLE5_ctr examples
Examples/MAX32665/Bluetooth/BLE_*
Examples/MAX32665/Bluetooth/Bootloader
)
# Other directories to watch
declare -a watched_other=(
#To test changes this workflow push a commit with this uncommented
#.github/workflows/
.github/workflows/ci-tests/Examples_tests
Libraries/libs.mk
# Bluetooth
Libraries/BlePhy/MAX32665
Libraries/Cordio
# Board specific
Libraries/Boards/MAX32665
# Libraries
Libraries/CMSIS/Device/Maxim/MAX32665
Libraries/PeriphDrivers/libPeriphDriver.mk
Libraries/PeriphDrivers/periphdriver.mk
Libraries/PeriphDrivers/max32665_files.mk
# Flash controller
Libraries/PeriphDrivers/Source/FLC/flc_common.c
Libraries/PeriphDrivers/Source/FLC/flc_common.h
Libraries/PeriphDrivers/Source/FLC/flc_me14.c
Libraries/PeriphDrivers/Source/FLC/flc_reva.c
Libraries/PeriphDrivers/Source/FLC/flc_reva.h
# GPIO
Libraries/PeriphDrivers/Source/GPIO/gpio_common.c
Libraries/PeriphDrivers/Source/GPIO/gpio_common.h
Libraries/PeriphDrivers/Source/GPIO/gpio_me14.c
Libraries/PeriphDrivers/Source/GPIO/gpio_reva.c
Libraries/PeriphDrivers/Source/GPIO/gpio_reva.h
# LowPower
Libraries/PeriphDrivers/Source/LP/lp_me14.c
# Simo
Libraries/PeriphDrivers/Source/SIMO/simo_me14.c
Libraries/PeriphDrivers/Source/SIMO/simo_reva_regs.h
Libraries/PeriphDrivers/Source/SIMO/simo_.c
Libraries/PeriphDrivers/Source/SIMO/simo_.h
# System
Libraries/PeriphDrivers/Source/SYS/mxc_assert.c
Libraries/PeriphDrivers/Source/SYS/mxc_delay.c
Libraries/PeriphDrivers/Source/SYS/mxc_lock.c
Libraries/PeriphDrivers/Source/SYS/mxc_table.c
Libraries/PeriphDrivers/Source/SYS/pins_me14.c
Libraries/PeriphDrivers/Source/SYS/sys_me14.c
# Timer
Libraries/PeriphDrivers/Source/TMR/tmr_common.c
Libraries/PeriphDrivers/Source/TMR/tmr_common.h
Libraries/PeriphDrivers/Source/TMR/tmr_me14.c
Libraries/PeriphDrivers/Source/TMR/tmr_reva_regs.h
Libraries/PeriphDrivers/Source/TMR/tmr_reva.c
Libraries/PeriphDrivers/Source/TMR/tmr_reva.h
# TPU
Libraries/PeriphDrivers/Source/TPU/tpu_me14.c
Libraries/PeriphDrivers/Source/TPU/tpu_reva_regs.h
Libraries/PeriphDrivers/Source/TPU/tpu_reva.c
Libraries/PeriphDrivers/Source/TPU/tpu_reva.h
# True Random Number Generator
Libraries/PeriphDrivers/Source/TRNG/trng_me14.c
Libraries/PeriphDrivers/Source/TRNG/trng_revb_regs.h
Libraries/PeriphDrivers/Source/TRNG/trng_revb.c
Libraries/PeriphDrivers/Source/TRNG/trng_revb.h
# UART
Libraries/PeriphDrivers/Source/UART/uart_common.c
Libraries/PeriphDrivers/Source/UART/uart_common.h
Libraries/PeriphDrivers/Source/UART/uart_me14.c
Libraries/PeriphDrivers/Source/UART/uart_reva_regs.h
Libraries/PeriphDrivers/Source/UART/uart_reva.c
Libraries/PeriphDrivers/Source/UART/uart_reva.h
# WakeUp Timer
Libraries/PeriphDrivers/Source/WUT/wut_me14.c
Libraries/PeriphDrivers/Source/WUT/wut_reva_regs.h
Libraries/PeriphDrivers/Source/WUT/wut_reva.c
Libraries/PeriphDrivers/Source/WUT/wut_reva_regs.h )
# Directories to ignore
declare -a ignored=(
Libraries/Cordio/docs
Documentation
)
# Create an associative array for ignored()
declare -A aignored=()
for ignore in "${ignored[@]}"; do aignored["${ignore%/}"]=1; done
# Copy the working directory list, skipping entries in ignored()
declare -a results_other=()
for watch in "${watched_other[@]}"; do test -v aignored["${watch%/}"] || results_other+=("${watch%/}"); done
# Copy the working directory list, skipping entries in ignored()
declare -a results_examples=()
for watch in "${watched_examples[@]}"; do test -v aignored["${watch%/}"] || results_examples+=("${watch%/}"); done
# Print the resulting array, separated by newlines, in sorted order
printf "\r\n-------- Watched Examples ------------\r\n\r\n"
printf '%s\n' "${results_examples[@]}" | sort
printf "\r\n-----------------------------------\r\n"
# Print the resulting array, separated by newlines, in sorted order
printf "\r\n-------- Watched Other ------------\r\n\r\n"
printf '%s\n' "${results_other[@]}" | sort
printf "\r\n-----------------------------------\r\n"
#Get the diff from main
CHANGE_FILES=$(git diff --ignore-submodules --name-only remotes/origin/main)
# Assume we want to actually run the workflow if no files changed
if [[ "$CHANGE_FILES" != "" ]]; then
# Check if ALL test are required due to 'OTHER' non BLE example directory modified
for watch_file in "${results_other[@]}"; do
if [[ "$CHANGE_FILES" == *"$watch_file"* ]]; then
MAX32665_RUN_ALL_TEST=true
echo "MAX32665_RUN_ALL_TEST=true" >> $GITHUB_ENV
echo "Enabled all tests to run because $watch_file was modified"
fi
done
# Check to see which examples have been modified to only test those
for watch_file in "${results_examples[@]}"; do
if [[ "$CHANGE_FILES" == *"$watch_file"* ]]; then
MAX32665_BLE_FILES_CHANGED=true
echo "MAX32665_BLE_FILES_CHANGED=true" >> $GITHUB_ENV
example_to_test=$(basename "$watch_file")
# Store list of examples that need to be tested
examples_list+=($example_to_test)
echo "Enabled example tests to run because $watch_file was modified"
# If dats/c or OTAC/s were modified we should also test the connected functionality
if [[ $example_to_test == "BLE_dats" ]] || [[ $example_to_test == "BLE_datc" ]]; then
MAX32665_DATS_CONNECTED_TEST=true
echo "MAX32665_DATS_CONNECTED_TEST=true" >> $GITHUB_ENV
echo "Enabled Datsc connected test"
fi
if [[ $example_to_test == "BLE_otas" ]] || [[ $example_to_test == "BLE_otac" ]]; then
MAX32665_OTAS_CONNECTED_TEST=true
echo "MAX32665_OTAS_CONNECTED_TEST=true" >> $GITHUB_ENV
echo "Enabled OTA connected test"
fi
fi
done
# Save examples list to env varaible available across steps
echo "MAX32665_EXAMPLES_TO_TEST=${examples_list[@]}" >> $GITHUB_ENV
else
# Assume we want to actually run the workflow if no files changed
MAX32665_RUN_ALL_TEST=true
echo "MAX32665_RUN_ALL_TEST=true" >> $GITHUB_ENV
fi
# Lock main board and DUT if any connected test is required otherwise just lock DUT
if [[ $MAX32665_OTAS_CONNECTED_TEST == 'true' ]] || [[ $MAX32665_DATS_CONNECTED_TEST == 'true' ]] || [[ $MAX32665_RUN_ALL_TEST == 'true' ]]; then
echo "LOCK_MAX32655_B1=true" >> $GITHUB_ENV
echo "LOCK_MAX32665_B1=true" >> $GITHUB_ENV
elif [[ $MAX32665_BLE_FILES_CHANGED == 'true' ]]; then
echo "LOCK_MAX32665_B1=true" >> $GITHUB_ENV
else
echo "no tests enabled, NOT locking anything at this step"
fi
- name: Check MAX32690
if: false
id: MAX32690
env:
MAX32690_BLE_FILES_CHANGED: false
MAX32690_EXAMPLES_TO_TEST: ()
MAX32690_RUN_ALL_TEST: false
MAX32690_DATS_CONNECTED_TEST: false
MAX32690_OTAS_CONNECTED_TEST: false
run: |
# BLE examples to watch
declare -a watched_examples=(
# underscore in filter to ignore the BLE5_ctr examples
Examples/MAX32690/Bluetooth/BLE_*
Examples/MAX32690/Bluetooth/Bootloader
)
# Other directories to watch
declare -a watched_other=(
#To test changes this workflow push a commit with this uncommented
#.github/workflows/
.github/workflows/ci-tests/Examples_tests
Libraries/libs.mk
# Bluetooth
Libraries/BlePhy/MAX32690
Libraries/Cordio
# Board specific
Libraries/Boards/MAX32690
# Libraries
Libraries/CMSIS/Device/Maxim/MAX32690
Libraries/PeriphDrivers/libPeriphDriver.mk
Libraries/PeriphDrivers/periphdriver.mk
Libraries/PeriphDrivers/max32690_files.mk
# AES
Libraries/PeriphDrivers/Source/AES/aes_me18.c
Libraries/PeriphDrivers/Source/AES/aes_revb_regs.h
Libraries/PeriphDrivers/Source/AES/aes_revb.c
Libraries/PeriphDrivers/Source/AES/aes_revb.h
Libraries/PeriphDrivers/Source/AES/aeskeys_revb_regs.h
# Flash controller
Libraries/PeriphDrivers/Source/FLC/flc_common.c
Libraries/PeriphDrivers/Source/FLC/flc_common.h
Libraries/PeriphDrivers/Source/FLC/flc_me18.c
Libraries/PeriphDrivers/Source/FLC/flc_reva.c
Libraries/PeriphDrivers/Source/FLC/flc_reva.h
# GPIO
Libraries/PeriphDrivers/Source/GPIO/gpio_common.c
Libraries/PeriphDrivers/Source/GPIO/gpio_common.h
Libraries/PeriphDrivers/Source/GPIO/gpio_me18.c
Libraries/PeriphDrivers/Source/GPIO/gpio_reva.c
Libraries/PeriphDrivers/Source/GPIO/gpio_reva.h
# LowPower
Libraries/PeriphDrivers/Source/LP/lp_me18.c
# System
Libraries/PeriphDrivers/Source/SYS/mxc_assert.c
Libraries/PeriphDrivers/Source/SYS/mxc_delay.c
Libraries/PeriphDrivers/Source/SYS/mxc_lock.c
Libraries/PeriphDrivers/Source/SYS/mxc_table.c
Libraries/PeriphDrivers/Source/SYS/pins_me18.c
Libraries/PeriphDrivers/Source/SYS/sys_me18.c
# Timer
Libraries/PeriphDrivers/Source/TMR/tmr_common.c
Libraries/PeriphDrivers/Source/TMR/tmr_common.h
Libraries/PeriphDrivers/Source/TMR/tmr_me18.c
Libraries/PeriphDrivers/Source/TMR/tmr_revb_regs.h
Libraries/PeriphDrivers/Source/TMR/tmr_revb.c
Libraries/PeriphDrivers/Source/TMR/tmr_revb.h
# True Random Number Generator
Libraries/PeriphDrivers/Source/CTB/ctb_common.c
Libraries/PeriphDrivers/Source/CTB/ctb_common.h
Libraries/PeriphDrivers/Source/CTB/ctb_me18.c
Libraries/PeriphDrivers/Source/CTB/ctb_reva_regs.h
Libraries/PeriphDrivers/Source/CTB/ctb_reva.c
Libraries/PeriphDrivers/Source/CTB/ctb_reva.h
Libraries/PeriphDrivers/Source/CTB/trng_reva_regs.h
# UART
Libraries/PeriphDrivers/Source/UART/uart_common.c
Libraries/PeriphDrivers/Source/UART/uart_common.h
Libraries/PeriphDrivers/Source/UART/uart_me18.c
Libraries/PeriphDrivers/Source/UART/uart_revb_regs.h
Libraries/PeriphDrivers/Source/UART/uart_revb.c
Libraries/PeriphDrivers/Source/UART/uart_revb.h
# WakeUp Timer
Libraries/PeriphDrivers/Source/WUT/wut_me18.c
Libraries/PeriphDrivers/Source/WUT/wut_reva_regs.h
Libraries/PeriphDrivers/Source/WUT/wut_reva.c
Libraries/PeriphDrivers/Source/WUT/wut_reva_regs.h )
# Directories to ignore
declare -a ignored=(
Libraries/Cordio/docs
Documentation
)
# Create an associative array for ignored()
declare -A aignored=()
for ignore in "${ignored[@]}"; do aignored["${ignore%/}"]=1; done
# Copy the working directory list, skipping entries in ignored()
declare -a results_other=()
for watch in "${watched_other[@]}"; do test -v aignored["${watch%/}"] || results_other+=("${watch%/}"); done
# Copy the working directory list, skipping entries in ignored()
declare -a results_examples=()
for watch in "${watched_examples[@]}"; do test -v aignored["${watch%/}"] || results_examples+=("${watch%/}"); done
# Print the resulting array, separated by newlines, in sorted order
printf "\r\n-------- Watched Examples ------------\r\n\r\n"
printf '%s\n' "${results_examples[@]}" | sort
printf "\r\n-----------------------------------\r\n"
# Print the resulting array, separated by newlines, in sorted order
printf "\r\n-------- Watched Other ------------\r\n\r\n"
printf '%s\n' "${results_other[@]}" | sort
printf "\r\n-----------------------------------\r\n"
#Get the diff from main
CHANGE_FILES=$(git diff --ignore-submodules --name-only remotes/origin/main)
# Assume we want to actually run the workflow if no files changed
if [[ "$CHANGE_FILES" != "" ]]; then
# Check if ALL test are required due to 'OTHER' non BLE example directory modified
for watch_file in "${results_other[@]}"; do
if [[ "$CHANGE_FILES" == *"$watch_file"* ]]; then
MAX32690_RUN_ALL_TEST=true
echo "MAX32690_RUN_ALL_TEST=true" >> $GITHUB_ENV
echo "Enabled all tests to run because $watch_file was modified"
fi
done
# Check to see which examples have been modified to only test those
for watch_file in "${results_examples[@]}"; do
if [[ "$CHANGE_FILES" == *"$watch_file"* ]]; then
MAX32690_BLE_FILES_CHANGED=true
echo "MAX32690_BLE_FILES_CHANGED=true" >> $GITHUB_ENV
example_to_test=$(basename "$watch_file")
# Store list of examples that need to be tested
examples_list+=($example_to_test)
echo "Enabled example tests to run because $watch_file was modified"
# If dats/c or OTAC/s were modified we should also test the connected functionality
if [[ $example_to_test == "BLE_dats" ]] || [[ $example_to_test == "BLE_datc" ]]; then
MAX32690_DATS_CONNECTED_TEST=true
echo "MAX32690_DATS_CONNECTED_TEST=true" >> $GITHUB_ENV
echo "Enabled Datsc connected test"
fi
if [[ $example_to_test == "BLE_otas" ]] || [[ $example_to_test == "BLE_otac" ]]; then
MAX32690_OTAS_CONNECTED_TEST=true
echo "MAX32690_OTAS_CONNECTED_TEST=true" >> $GITHUB_ENV
echo "Enabled OTA connected test"
fi
fi
done
# Save examples list to env varaible available across steps
echo "MAX32690_EXAMPLES_TO_TEST=${examples_list[@]}" >> $GITHUB_ENV
else
# Assume we want to actually run the workflow if no files changed
MAX32690_RUN_ALL_TEST=true
echo "MAX32690_RUN_ALL_TEST=true" >> $GITHUB_ENV
fi
# Lock main board and DUT if any connected test is required otherwise just lock DUT
if [[ $MAX32690_OTAS_CONNECTED_TEST == 'true' ]] || [[ $MAX32690_DATS_CONNECTED_TEST == 'true' ]] || [[ $MAX32690_RUN_ALL_TEST == 'true' ]]; then
echo "LOCK_MAX32655_B1=true" >> $GITHUB_ENV
echo "LOCK_MAX32690_B1=true" >> $GITHUB_ENV
elif [[ $MAX32690_BLE_FILES_CHANGED == 'true' ]]; then
echo "LOCK_MAX32690_B1=true" >> $GITHUB_ENV
else
echo "no tests enabled, NOT locking anything at this step"
fi
- name: Lock Boards
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
boards: |
max32655_board1
max32655_board2
lock: true
timeout: 3600 # Attempt to lock for an hour
- name: Init Tests
run: |
#set advertising names
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_dats/dats_main.c
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_datc/datc_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_otas/dats_main.c
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_otac/datc_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32665/Bluetooth/BLE_otas/dats_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c
- name: Erase Boards DATS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
has_two_flash_banks: |
true
true
# true
# true
- name: Flash DATS 655
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
project: |
BLE_dats
BLE_datc
suppress_output: true
build_flags: |
ADV_NAME=DAT?
ADV_NAME=DAT?
build: true
distclean: true
- name: DATS 655
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
run: |
DATS_TEST_DIR=$TEST_DIR/dats
DATS_BOARD_655=max32655_board1
DATC_BOARD_655=max32655_board2
(cd $DATS_TEST_DIR && ls && python3 datsc_connected.py $DATS_BOARD_655 $DATC_BOARD_655)
- name: Erase Boards OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
- name: Flash OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
max32665_board1
build_flags: |
ADV_NAME=OTA?
ADV_NAME=OTA?
ADV_NAME=OTA!
ADV_NAME=OTA!
project: |
BLE_otas
BLE_otac
BLE_otac
suppress_output: true
build: true
distclean: true
- name: OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
run: |
OTAS_TEST_DIR=$TEST_DIR/otas
OTAS_BOARD_655=max32655_board1
OTAC_BOARD_655=max32655_board2
# OTAC_BOARD_665=max32665_board1
# OTAC_BOARD_690=max32690_board_w1
if [[ $MAX32655_OTAS_CONNECTED_TEST == 'true' ]]; then
(cd $OTAS_TEST_DIR && python3 otas_connected.py $OTAS_BOARD_655 $OTAC_BOARD_655)
fi
# disable for now
# (cd $OTAS_TEST_DIR && python3 otas_connected.py $OTAS_BOARD_655 $OTAC_BOARD_665)
# (cd $OTAS_TEST_DIR && python3 otas_connected.py $OTAS_BOARD_690 $OTAC_BOARD_655)
- name: Result Consolidation
if: failure()
run: |
set +e
rm -rf $RESULTS_DIR
mkdir $RESULTS_DIR
mv $TEST_DIR/dats/dats_out $RESULTS_DIR
mv $TEST_DIR/otas/otas_out $RESULTS_DIR
set -e
- name: Unlock Boards
if: always()
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
lock: false
all_owned: true
#----------------------------------------------------------------------------------------------
# Save test reports
- uses: actions/upload-artifact@v3
if: failure()
with:
name: failure-report
path: ${{ env.RESULTS_DIR }}
- name: Clean up
if: always()
run: |
git clean -ffdx
git reset --hard