summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-03-08 12:15:39 +0700
committerhathach <[email protected]>2023-03-08 12:15:39 +0700
commit9e0ae5f29d507e29b7c548eb4b1aa1ca019de65b (patch)
tree4821dbc09dae5fce66e124734a87f7b83f0ffc02 /tools
parent3387c8610876d15216d8ae3a0ce5e938824ead06 (diff)
improve ci
Diffstat (limited to 'tools')
-rw-r--r--tools/build_utils.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/build_utils.py b/tools/build_utils.py
index a24cea7bb..de9052d2d 100644
--- a/tools/build_utils.py
+++ b/tools/build_utils.py
@@ -85,21 +85,22 @@ def build_example(example, board, make_option):
# succeeded, failed, skipped
ret = [0, 0, 0]
+ make_cmd = "make -j -C examples/{} BOARD={} {}".format(example, board, make_option)
+
# Check if board is skipped
if skip_example(example, board):
status = SKIPPED
ret[2] = 1
print(build_format.format(example, board, status, '-', flash_size, sram_size))
else:
- build_result = subprocess.run("make -j -C examples/{} BOARD={} {} all".format(example, board, make_option), shell=True,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ subprocess.run(make_cmd + " clean", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ build_result = subprocess.run(make_cmd + " all", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if build_result.returncode == 0:
status = SUCCEEDED
ret[0] = 1
- (flash_size, sram_size) = build_size(example, board)
- subprocess.run("make -j -C examples/{} BOARD={} {} copy-artifact".format(example, board, make_option), shell=True,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ (flash_size, sram_size) = build_size(make_cmd)
+ #subprocess.run(make_cmd + " copy-artifact", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
else:
status = FAILED
ret[1] = 1
@@ -113,9 +114,8 @@ def build_example(example, board, make_option):
return ret
-def build_size(example, board):
- size_cmd = 'make -j -C examples/{} BOARD={} size'.format(example, board)
- size_output = subprocess.run(size_cmd, shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
+def build_size(make_cmd):
+ size_output = subprocess.run(make_cmd + ' size', shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
for i, l in enumerate(size_output):
text_title = 'text data bss dec'
if text_title in l: