Skip to content

Commit fe2e978

Browse files
committed
Merge branch 'master' of github.com:adafruit/Adafruit_nRF52_Arduino
2 parents a592ec8 + 5cea31b commit fe2e978

File tree

8 files changed

+26
-44
lines changed

8 files changed

+26
-44
lines changed

.github/workflows/githubci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@ jobs:
4141
- name: Install BSP and Libraries
4242
env:
4343
BSP_URL: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
44+
BSP_PATH: .arduino15/packages/adafruit/hardware/nrf52
4445
run: |
4546
arduino-cli config init
4647
arduino-cli core update-index
4748
arduino-cli core update-index --additional-urls $BSP_URL
4849
arduino-cli core install adafruit:nrf52 --additional-urls $BSP_URL
49-
BSP_PATH=$HOME/.arduino15/packages/adafruit/hardware/nrf52
50-
BSP_VERSION=`eval ls $BSP_PATH`
51-
rm -r $BSP_PATH/*
52-
ln -s $GITHUB_WORKSPACE $BSP_PATH/$BSP_VERSION
50+
# Repalce release BSP with our code
51+
BSP_VERSION=`eval ls $HOME/$BSP_PATH`
52+
rm -r $HOME/$BSP_PATH/*
53+
ln -s $GITHUB_WORKSPACE $HOME/$BSP_PATH/$BSP_VERSION
5354
arduino-cli lib install "Adafruit NeoPixel" "Adafruit NeoMatrix" "Adafruit GFX Library" "Adafruit SSD1306" "MIDI Library" "Adafruit ILI9341" "Adafruit HX8357 Library" "Adafruit Circuit Playground" "Firmata"
5455
5556
- name: Build examples

libraries/Bluefruit52Lib/examples/Projects/homekit/homekit_lightbulb/.skip

Whitespace-only changes.

tools/build_all.py

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,24 @@
44
import subprocess
55
import time
66

7-
travis = False
8-
if "TRAVIS" in os.environ and os.environ["TRAVIS"] == "true":
9-
travis = True
10-
117
all_warnings = False
12-
if "ALL_WARNINGS" in os.environ and os.environ["ALL_WARNINGS"] == "true":
13-
all_warnings = True
14-
15-
ENV_VARIABLE_NAME = 'VARIANT'
16-
17-
188
exit_status = 0
199
success_count = 0
2010
fail_count = 0
11+
skip_count = 0
2112

22-
build_format = '| {:20} | {:30} | {:9} '
23-
build_separator = '-' * 78
13+
build_format = '| {:20} | {:35} | {:9} '
14+
build_separator = '-' * 83
2415

25-
variants_dict = {
26-
'feather52832': 'Feather nRF52832',
27-
'feather52840': 'Feather nRF52840 Express',
28-
'cplaynrf52840': 'Circuit Playground Bluefruit Express',
29-
'itsybitsy52840': 'ItsyBitsy nRF52840 Express',
30-
'cluenrf52840': 'CLUE nRF52840'
31-
}
16+
default_boards = [ 'feather52832', 'feather52840', 'cplaynrf52840', 'itsybitsy52840', 'cluenrf52840' ]
3217

33-
all_variants = []
18+
build_boards = []
3419

3520
# build all variants if input not existed
3621
if len(sys.argv) > 1:
37-
if (sys.argv[1] in variants_dict):
38-
all_variants.append(sys.argv[1])
39-
else:
40-
print('\033[31INTERNAL ERR\033[0m - invalid variant name "{}"'.format(sys.argv[1]))
41-
sys.exit(-1)
22+
build_boards.append(sys.argv[1])
4223
else:
43-
all_variants = list(variants_dict.keys())
44-
45-
print(all_variants)
46-
exit
24+
build_boards = default_boards
4725

4826
def errorOutputFilter(line):
4927
if len(line) == 0:
@@ -55,11 +33,11 @@ def errorOutputFilter(line):
5533

5634

5735
def build_examples(variant):
58-
global exit_status, success_count, fail_count, build_format, build_separator
36+
global exit_status, success_count, fail_count, skip_count, build_format, build_separator
5937

6038
print('\n')
6139
print(build_separator)
62-
print('| {:^74} |'.format(variants_dict[variant]))
40+
print('| {:^79} |'.format('Board ' + variant))
6341
print(build_separator)
6442
print((build_format + '| {:6} |').format('Library', 'Example', 'Result', 'Time'))
6543
print(build_separator)
@@ -69,12 +47,13 @@ def build_examples(variant):
6947
for sketch in glob.iglob('libraries/**/*.ino', recursive=True):
7048
start_time = time.monotonic()
7149

72-
# skip if example contains: ".skip" or ".skip.variant"
73-
# however ".build.variant" file can overwrite ".skip", used to build a specific variant only
50+
# Skip if contains: ".board.test.skip" or ".all.test.skip"
51+
# Skip if not contains: ".board.test.only" for a specific board
7452
sketchdir = os.path.dirname(sketch)
75-
if ( (os.path.exists(sketchdir + '/.skip') or os.path.exists(sketchdir + '/.skip.' + variant)) and
76-
not os.path.exists(sketchdir + '/.build.' + variant)):
77-
success = "skipped"
53+
if os.path.exists(sketchdir + '/.all.test.skip') or os.path.exists(sketchdir + '/.' + variant + '.test.skip'):
54+
success = "\033[33mskipped\033[0m "
55+
elif glob.glob(sketchdir+"/.*.test.only") and not os.path.exists(sketchdir + '/.build.' + variant):
56+
success = "\033[33mskipped\033[0m "
7857
else:
7958
# TODO - preferably, would have STDERR show up in **both** STDOUT and STDERR.
8059
# preferably, would use Python logging handler to get both distinct outputs and one merged output
@@ -106,24 +85,26 @@ def build_examples(variant):
10685

10786
print((build_format + '| {:5.2f}s |').format(sketch.split(os.path.sep)[1], os.path.basename(sketch), success, build_duration))
10887

109-
if success != "skipped":
88+
if success != "\033[33mskipped\033[0m ":
11089
if build_result.returncode != 0:
11190
print(build_result.stdout.decode("utf-8"))
11291
if (build_result.stderr):
11392
print(build_result.stderr.decode("utf-8"))
11493
if len(warningLines) != 0:
11594
for line in warningLines:
11695
print(line)
96+
else:
97+
skip_count += 1
11798

11899

119100
build_time = time.monotonic()
120101

121-
for var in all_variants:
122-
build_examples(var)
102+
for board in build_boards:
103+
build_examples(board)
123104

124105
print(build_separator)
125106
build_time = time.monotonic() - build_time
126-
print("Build Summary: {} \033[32msucceeded\033[0m, {} \033[31mfailed\033[0m and took {:.2f}s".format(success_count, fail_count, build_time))
107+
print("Build Summary: {} \033[32msucceeded\033[0m, {} \033[31mfailed\033[0m, {} \033[33mskipped\033[0m and took {:.2f}s".format(success_count, fail_count, skip_count, build_time))
127108
print(build_separator)
128109

129110
sys.exit(exit_status)

0 commit comments

Comments
 (0)