update ci script

This commit is contained in:
hathach 2020-07-19 14:19:39 +07:00
parent 798fad397a
commit a0f6fa4e06
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
2 changed files with 22 additions and 15 deletions

View File

@ -14,26 +14,33 @@ total_time = time.monotonic()
build_format = '| {:23} | {:30} | {:9} | {:7} | {:6} | {:6} |'
build_separator = '-' * 100
# 1st Argument is Example, build all examples if not existed
# If examples are not specified in arguments, build all
all_examples = []
for entry in os.scandir("examples/device"):
if entry.is_dir():
all_examples.append(entry.name)
if len(sys.argv) > 1:
all_examples.append(sys.argv[1])
else:
for entry in os.scandir("examples/device"):
if entry.is_dir():
all_examples.append(entry.name)
input_examples = list(set(all_examples).intersection(sys.argv))
if len(input_examples) > 0:
all_examples = input_examples
all_examples.sort()
# 2nd Argument is Board, build all boards if not existed
# If boards are not specified in arguments, build all
all_boards = []
if len(sys.argv) > 2:
all_boards.append(sys.argv[2])
else:
for entry in os.scandir("hw/bsp"):
if entry.is_dir():
all_boards.append(entry.name)
all_boards.sort()
for entry in os.scandir("hw/bsp"):
if entry.is_dir():
all_boards.append(entry.name)
if len(sys.argv) > 1:
input_boards = list(set(all_boards).intersection(sys.argv))
if len(input_boards) > 0:
all_boards = input_boards
all_boards.sort()
def build_example(example, board):
subprocess.run("make -C examples/device/{} BOARD={} clean".format(example, board), shell=True,

View File

@ -42,7 +42,7 @@ all_boards.sort()
def build_example(example, board):
subprocess.run("make -C examples/device/{} BOARD={} clean".format(example, board), shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return subprocess.run("make -j 4 -C examples/device/{} BOARD={} all".format(example, board), shell=True,
return subprocess.run("make -C examples/device/{} BOARD={} all".format(example, board), shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
def build_size(example, board):