diff options
| author | Kenny <3454741+WarriorOfWire@users.noreply.github.com> | 2020-07-24 20:44:55 -0700 |
|---|---|---|
| committer | Kenny <3454741+WarriorOfWire@users.noreply.github.com> | 2020-07-24 22:08:56 -0700 |
| commit | 11d225fe6238d7af0e189232766c16b089d63c59 (patch) | |
| tree | a3c9b37892f3fdeb9e4323ee693940b196ebfbee /tools/build_release_files.py | |
| parent | a6e048686fe6999c4231582b7d9e69a7dc679257 (diff) | |
Use 2 cores per job in github build
As of today, https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
states that hosted runners have a 2-core CPU.
This uses make -j $physical_cores to try and be better about utilizing the time spent on those machines.
When github upgrades runners to have more cores we'll benefit from that too.
Diffstat (limited to 'tools/build_release_files.py')
| -rwxr-xr-x | tools/build_release_files.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 3563dd99f..1209c18ad 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: MIT import os +import multiprocessing import sys import subprocess import shutil @@ -27,6 +28,8 @@ sha, version = build_info.get_version_info() languages = build_info.get_languages() exit_status = 0 +cores = multiprocessing.cpu_count() +print('building boards with parallelism {}'.format(cores)) for board in build_boards: bin_directory = "../bin/{}/".format(board) os.makedirs(bin_directory, exist_ok=True) @@ -41,8 +44,8 @@ for board in build_boards: # But sometimes a particular language needs to be built from scratch, if, for instance, # CFLAGS_INLINE_LIMIT is set for a particular language to make it fit. clean_build_check_result = subprocess.run( - "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( - port = board_info["port"], language=language, board=board), + "make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build -j {cores} | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format( + port = board_info["port"], language=language, board=board, cores=cores), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) clean_build = clean_build_check_result.returncode == 0 |
