From 31e21d8b389d0cc229840dbf55a2aa8836f0360c Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 3 May 2019 14:05:14 +0700 Subject: [PATCH] add travis badge, make with 4 thread --- README.md | 4 +++- tools/build_all.py | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 22b5b1a..f977929 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Adafruit Bluefruit nRF52 Bootloader +# Adafruit nRF52 Bootloader + +[![Build Status](https://travis-ci.com/adafruit/Adafruit_nRF52_Bootloader.svg?branch=master)](https://travis-ci.com/adafruit/Adafruit_nRF52_Bootloader) This is a CDC/DFU/UF2 bootloader for nRF52 boards. diff --git a/tools/build_all.py b/tools/build_all.py index 5411a76..2c75588 100644 --- a/tools/build_all.py +++ b/tools/build_all.py @@ -7,10 +7,8 @@ import time subprocess.run("rm -rf _build*", shell=True) subprocess.run("rm -rf bin/*", shell=True) -PARALLEL = "-j 5" travis = False if "TRAVIS" in os.environ and os.environ["TRAVIS"] == "true": - PARALLEL="-j 2" travis = True exit_status = 0 @@ -21,12 +19,14 @@ for entry in os.scandir("src/boards"): #sha, version = build_info.get_version_info() +total_time = time.monotonic() + for board in all_boards: bin_directory = "bin/{}/".format(board) os.makedirs(bin_directory, exist_ok=True) start_time = time.monotonic() - make_result = subprocess.run("make BOARD={} combinehex genpkg".format(board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + make_result = subprocess.run("make -j 4 BOARD={} combinehex genpkg".format(board), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) build_duration = time.monotonic() - start_time success = "\033[32msucceeded\033[0m" if make_result.returncode != 0: @@ -48,4 +48,7 @@ for board in all_boards: print() +total_time = time.monotonic() - total_time +print("Total build time took {:.2f}s".format(total_time)) + sys.exit(exit_status)