mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
update ci script
This commit is contained in:
parent
798fad397a
commit
a0f6fa4e06
@ -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,
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user