Merge pull request #7235 from MicroDev1/ci

Fix json parse issue in ci_set_matrix.py
This commit is contained in:
Scott Shawcroft 2022-11-21 13:06:06 -08:00 committed by GitHub
commit c12e2a170d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -140,14 +140,14 @@ jobs:
if: github.event_name == 'pull_request'
uses: tj-actions/changed-files@v34
with:
json: "true"
json: true
sha: ${{ steps.get-last-commit-with-checks.outputs.commit && github.event.after }}
base_sha: ${{ steps.get-last-commit-with-checks.outputs.commit }}
- name: Set matrix
id: set-matrix
working-directory: tools
env:
CHANGED_FILES: ${{ toJSON(steps.get-changes.outputs.all_changed_and_modified_files) }}
CHANGED_FILES: ${{ steps.get-changes.outputs.all_changed_and_modified_files }}
LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.checkruns }}
run: python3 -u ci_set_matrix.py

View File

@ -69,7 +69,7 @@ else:
changed_files = []
else:
print("Using files list in CHANGED_FILES")
changed_files = json.loads(c)
changed_files = json.loads(c.replace("\\", ""))
j = os.environ["LAST_FAILED_JOBS"]
if j == "":
@ -203,7 +203,7 @@ def set_boards_to_build(build_all):
# Split boards by architecture.
print("Building boards:")
arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []}
for board in boards_to_build:
for board in sorted(boards_to_build):
print(" ", board)
port = board_to_port.get(board)
# A board can appear due to its _deletion_ (rare)
@ -220,6 +220,7 @@ def set_boards_to_build(build_all):
failed_boards = last_failed_jobs[f"build-{arch}"]
for board in failed_boards:
if not board in arch_to_boards[arch]:
print(" ", board)
arch_to_boards[arch].append(board)
# Set Output
set_output(f"boards-{arch}", json.dumps(sorted(arch_to_boards[arch])))