Merge pull request #7627 from MicroDev1/ci
Re-enable changes per commit
This commit is contained in:
commit
932b10f551
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@ -54,17 +54,16 @@ jobs:
|
||||
uses: ./.github/actions/deps/external
|
||||
with:
|
||||
action: cache
|
||||
# Disabled: Needs to be updated
|
||||
# - name: Get last commit with checks
|
||||
# id: get-last-commit-with-checks
|
||||
# if: github.event_name == 'pull_request'
|
||||
# working-directory: tools
|
||||
# run: python3 -u ci_changes_per_commit.py
|
||||
# env:
|
||||
# REPO: ${{ github.repository }}
|
||||
# PULL: ${{ github.event.number }}
|
||||
# GITHUB_TOKEN: ${{ github.token }}
|
||||
# EXCLUDE_COMMIT: ${{ github.event.after }}
|
||||
- name: Get last commit with checks
|
||||
id: get-last-commit-with-checks
|
||||
if: github.event_name == 'pull_request'
|
||||
working-directory: tools
|
||||
run: python3 -u ci_changes_per_commit.py
|
||||
env:
|
||||
REPO: ${{ github.repository }}
|
||||
PULL: ${{ github.event.number }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
EXCLUDE_COMMIT: ${{ github.event.after }}
|
||||
- name: Set up mpy-cross
|
||||
uses: ./.github/actions/mpy_cross
|
||||
with:
|
||||
|
@ -166,26 +166,14 @@ def get_commit_depth_and_check_suite(query_commits):
|
||||
return [None, None]
|
||||
|
||||
|
||||
def append_runs_to_list(runs, bad_runs_by_matrix):
|
||||
regex_matrix = re.compile("^build-[^ ]+")
|
||||
regex_board = re.compile("\([^ ]+\)$")
|
||||
for run in runs["nodes"]:
|
||||
name = run["name"]
|
||||
res_matrix = regex_matrix.search(name)
|
||||
if res_matrix:
|
||||
matrix = res_matrix.group()
|
||||
if matrix not in bad_runs_by_matrix:
|
||||
bad_runs_by_matrix[matrix] = []
|
||||
res_board = regex_board.search(name)
|
||||
if res_board:
|
||||
bad_runs_by_matrix[matrix].append(res_board.group()[1:-1])
|
||||
|
||||
|
||||
def get_bad_check_runs(query_check_runs):
|
||||
more_pages = True
|
||||
bad_runs_by_matrix = {}
|
||||
|
||||
run_types = ["failed", "incomplete"]
|
||||
|
||||
regex_matrix = re.compile("^[^\n ]+ \/ (build|run) \([^\n ]+\)$")
|
||||
|
||||
while more_pages:
|
||||
check_runs = query_check_runs.fetch()["data"]["node"]
|
||||
more_pages = False
|
||||
@ -194,7 +182,17 @@ def get_bad_check_runs(query_check_runs):
|
||||
run_type_camel = run_type.capitalize() + "Run"
|
||||
run_type = run_type + "Runs"
|
||||
|
||||
append_runs_to_list(check_runs[run_type], bad_runs_by_matrix)
|
||||
for check_run in check_runs[run_type]["nodes"]:
|
||||
name = check_run["name"]
|
||||
res_matrix = regex_matrix.search(name)
|
||||
if res_matrix:
|
||||
matrix = name.split(" /", 1)[0]
|
||||
matrix_job = name.split(" (", 1)[1][:-1]
|
||||
bad_runs_by_matrix.setdefault(matrix, []).append(matrix_job)
|
||||
elif name != "scheduler":
|
||||
bad_runs_by_matrix[name] = True
|
||||
else:
|
||||
return {}
|
||||
|
||||
if query_check_runs.paginate(
|
||||
check_runs[run_type]["pageInfo"], "after" + run_type_camel
|
||||
|
@ -92,6 +92,9 @@ def set_output(name: str, value):
|
||||
|
||||
|
||||
def set_boards_to_build(build_all: bool):
|
||||
if "mpy_cross" in last_failed_jobs or "tests" in last_failed_jobs:
|
||||
build_all = True
|
||||
|
||||
# Get boards in json format
|
||||
boards_info_json = build_board_info.get_board_mapping()
|
||||
all_board_ids = set()
|
||||
|
Loading…
Reference in New Issue
Block a user