Merge pull request #7627 from MicroDev1/ci

Re-enable changes per commit
This commit is contained in:
Dan Halbert 2023-02-21 23:04:04 -05:00 committed by GitHub
commit 932b10f551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 27 deletions

View File

@ -54,17 +54,16 @@ jobs:
uses: ./.github/actions/deps/external uses: ./.github/actions/deps/external
with: with:
action: cache action: cache
# Disabled: Needs to be updated - name: Get last commit with checks
# - name: Get last commit with checks id: get-last-commit-with-checks
# id: get-last-commit-with-checks if: github.event_name == 'pull_request'
# if: github.event_name == 'pull_request' working-directory: tools
# working-directory: tools run: python3 -u ci_changes_per_commit.py
# run: python3 -u ci_changes_per_commit.py env:
# env: REPO: ${{ github.repository }}
# REPO: ${{ github.repository }} PULL: ${{ github.event.number }}
# PULL: ${{ github.event.number }} GITHUB_TOKEN: ${{ github.token }}
# GITHUB_TOKEN: ${{ github.token }} EXCLUDE_COMMIT: ${{ github.event.after }}
# EXCLUDE_COMMIT: ${{ github.event.after }}
- name: Set up mpy-cross - name: Set up mpy-cross
uses: ./.github/actions/mpy_cross uses: ./.github/actions/mpy_cross
with: with:

View File

@ -166,26 +166,14 @@ def get_commit_depth_and_check_suite(query_commits):
return [None, None] 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): def get_bad_check_runs(query_check_runs):
more_pages = True more_pages = True
bad_runs_by_matrix = {} bad_runs_by_matrix = {}
run_types = ["failed", "incomplete"] run_types = ["failed", "incomplete"]
regex_matrix = re.compile("^[^\n ]+ \/ (build|run) \([^\n ]+\)$")
while more_pages: while more_pages:
check_runs = query_check_runs.fetch()["data"]["node"] check_runs = query_check_runs.fetch()["data"]["node"]
more_pages = False more_pages = False
@ -194,7 +182,17 @@ def get_bad_check_runs(query_check_runs):
run_type_camel = run_type.capitalize() + "Run" run_type_camel = run_type.capitalize() + "Run"
run_type = run_type + "Runs" 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( if query_check_runs.paginate(
check_runs[run_type]["pageInfo"], "after" + run_type_camel check_runs[run_type]["pageInfo"], "after" + run_type_camel

View File

@ -92,6 +92,9 @@ def set_output(name: str, value):
def set_boards_to_build(build_all: bool): 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 # Get boards in json format
boards_info_json = build_board_info.get_board_mapping() boards_info_json = build_board_info.get_board_mapping()
all_board_ids = set() all_board_ids = set()