refactor `boards / build` to `ports / board`

This commit is contained in:
MicroDev 2023-03-07 03:22:31 +05:30
parent b17364a447
commit 03bb7ff652
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
4 changed files with 11 additions and 13 deletions

View File

@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
outputs:
docs: ${{ steps.set-matrix.outputs.docs }}
boards: ${{ steps.set-matrix.outputs.boards }}
ports: ${{ steps.set-matrix.outputs.ports }}
windows: ${{ steps.set-matrix.outputs.windows }}
cp-version: ${{ steps.set-up-submodules.outputs.version }}
steps:
@ -94,7 +94,7 @@ jobs:
mpy-cross:
needs: scheduler
if: needs.scheduler.outputs.boards != '{}'
if: needs.scheduler.outputs.ports != '{}'
uses: ./.github/workflows/re-build-mpy-cross.yml
secrets: inherit
with:
@ -103,7 +103,7 @@ jobs:
mpy-cross-mac:
runs-on: macos-11
needs: scheduler
if: needs.scheduler.outputs.boards != '{}'
if: needs.scheduler.outputs.ports != '{}'
env:
CP_VERSION: ${{ needs.scheduler.outputs.cp-version }}
steps:
@ -281,15 +281,15 @@ jobs:
# ERROR: Platform MINGW64_NT-10.0-17763-x86_64 appears to be unsupported
# https://github.com/espressif/esp-idf/issues/7062
boards:
ports:
needs: [scheduler, mpy-cross, tests]
if: needs.scheduler.outputs.boards != '{}'
if: needs.scheduler.outputs.ports != '{}'
uses: ./.github/workflows/re-build-boards.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
port: ${{ fromJSON(needs.scheduler.outputs.boards).ports }}
port: ${{ fromJSON(needs.scheduler.outputs.ports).ports }}
with:
boards: ${{ toJSON(fromJSON(needs.scheduler.outputs.boards)[matrix.port]) }}
boards: ${{ toJSON(fromJSON(needs.scheduler.outputs.ports)[matrix.port]) }}
cp-version: ${{ needs.scheduler.outputs.cp-version }}

View File

@ -16,7 +16,7 @@ on:
required: false
jobs:
build:
board:
runs-on: ubuntu-22.04
env:
CP_VERSION: ${{ inputs.cp-version }}

View File

@ -184,7 +184,7 @@ def get_bad_check_runs(query_check_runs):
for check_run in check_runs[run_type]["nodes"]:
name = check_run["name"]
if name.startswith("boards") or regex_matrix.search(name):
if name.startswith("ports") or regex_matrix.search(name):
matrix = name.split(" ", 1)[0]
matrix_job = name.rsplit(" (", 1)[1][:-1]
bad_runs.setdefault(matrix, []).append(matrix_job)

View File

@ -213,9 +213,7 @@ def set_boards(build_all: bool):
break
# Append previously failed boards
last_failed_boards = last_failed_jobs.get("boards")
if last_failed_boards:
boards_to_build.update(last_failed_boards)
boards_to_build.update(last_failed_jobs.get("ports") or [])
print("Building boards:", bool(boards_to_build))
@ -236,7 +234,7 @@ def set_boards(build_all: bool):
port_to_boards_to_build["ports"] = sorted(list(port_to_boards_to_build.keys()))
# Set the step outputs
set_output("boards", json.dumps(port_to_boards_to_build))
set_output("ports", json.dumps(port_to_boards_to_build))
def set_docs(build_doc: bool):