forked from adafruit/circuitpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for adding release info into adafruit/circuitpython-org
This also changes the build script to python with better output.
- Loading branch information
Showing
12 changed files
with
354 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build-*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import os | ||
from sh import rm | ||
from sh import make | ||
import sys | ||
import subprocess | ||
import shutil | ||
import build_board_info as build_info | ||
import time | ||
|
||
for port in build_info.SUPPORTED_PORTS: | ||
rm("-rf", "../ports/{}/build*".format(port)) | ||
|
||
ROSIE_SETUPS = ["rosie-ci"] | ||
rosie_ok = {} | ||
for rosie in ROSIE_SETUPS: | ||
rosie_ok[rosie] = True | ||
|
||
PARALLEL = "-j 5" | ||
travis = False | ||
if "TRAVIS" in os.environ and os.environ["TRAVIS"] == "true": | ||
PARALLEL="-j 2" | ||
travis = True | ||
|
||
all_boards = build_info.get_board_mapping() | ||
build_boards = list(all_boards.keys()) | ||
if "TRAVIS_BOARDS" in os.environ: | ||
build_boards = os.environ["TRAVIS_BOARDS"].split() | ||
|
||
sha, version = build_info.get_version_info() | ||
|
||
languages = build_info.get_languages() | ||
exit_status = 0 | ||
for board in build_boards: | ||
bin_directory = "../bin/{}/".format(board) | ||
os.makedirs(bin_directory, exist_ok=True) | ||
board_info = all_boards[board] | ||
|
||
for language in languages: | ||
start_time = time.monotonic() | ||
make_result = subprocess.run("make -C ../ports/" + board_info["port"] + " TRANSLATION=" + language + " BOARD=" + board, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
build_duration = time.monotonic() - start_time | ||
success = "\033[32msucceeded\033[0m" | ||
if make_result.returncode != 0: | ||
exit_status = make_result.returncode | ||
success = "\033[31mfailed\033[0m" | ||
|
||
for extension in board_info["extensions"]: | ||
temp_filename = "../ports/{port}/build-{board}/firmware.{extension}".format(port=board_info["port"], board=board, extension=extension) | ||
final_filename = "adafruit-circuitpython-{board}-{language}-{version}.{extension}".format(board=board, language=language, version=version, extension=extension) | ||
final_filename = os.path.join(bin_directory, final_filename) | ||
shutil.copyfile(temp_filename, final_filename) | ||
|
||
if travis: | ||
print('travis_fold:start:adafruit-bins-{}-{}\\r'.format(language, board)) | ||
print("Build {} for {} took {:.2f}s and {}".format(board, language, build_duration, success)) | ||
print(len(make_result.stdout)) | ||
print(make_result.stdout.decode("utf-8")) | ||
# Only upload to Rosie if its a pull request. | ||
if travis: | ||
for rosie in ROSIE_SETUPS: | ||
if not rosie_ok[rosie]: | ||
break | ||
print("Uploading to https://{rosie}.ngrok.io/upload/{sha}".format(rosie=rosie, sha=sha)) | ||
#curl -F "file=@$final_filename" https://$rosie.ngrok.io/upload/$sha | ||
if travis: | ||
print('travis_fold:end:adafruit-bins-{}-{}\\r'.format(language, board)) | ||
|
||
print() | ||
|
||
sys.exit(exit_status) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.