Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/build-board-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,18 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Board to port
id: board-to-port
run: |
PORT=$(python tools/board_to_port.py "${{ inputs.board }}")
echo "port=$PORT" >> $GITHUB_OUTPUT
shell: bash
- name: Set up port
id: set-up-port
uses: ./.github/actions/deps/ports
with:
board: ${{ inputs.board }}
port: ${{ steps.board-to-port.outputs.port }}
- name: Set up submodules
id: set-up-submodules
uses: ./.github/actions/deps/submodules
Expand All @@ -88,7 +95,7 @@ jobs:
uses: ./.github/actions/deps/external
with:
action: cache
port: ${{ steps.set-up-port.outputs.port }}
port: ${{ steps.board-to-port.outputs.port }}
- name: Set up mpy-cross
if: steps.set-up-submodules.outputs.frozen == 'True'
uses: ./.github/actions/mpy_cross
Expand All @@ -115,9 +122,9 @@ jobs:
FLAGS: ${{ inputs.flags }}
DEBUG: ${{ inputs.debug && '1' || '0' }}
run: make -j4 $FLAGS BOARD="$BOARD" DEBUG=$DEBUG TRANSLATION="$TRANSLATION"
working-directory: ports/${{ steps.set-up-port.outputs.port }}
working-directory: ports/${{ steps.board-to-port.outputs.port }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.board }}-${{ inputs.language }}-${{ inputs.version }}${{ inputs.flags != '' && '-custom' || '' }}${{ inputs.debug && '-debug' || '' }}
path: ports/${{ steps.set-up-port.outputs.port }}/build-${{ inputs.board }}/firmware.*
path: ports/${{ steps.board-to-port.outputs.port }}/build-${{ inputs.board }}/firmware.*
22 changes: 22 additions & 0 deletions tools/board_to_port.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: 2025 CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT

import sys
from pathlib import Path

docs = Path(__file__).parent.parent / "docs"
sys.path.append(str(docs))
from shared_bindings_matrix import get_board_mapping

board = sys.argv[1]

board_mapping = get_board_mapping()
if board in board_mapping:
board_info = board_mapping[board]
print(board_info["port"])
sys.exit(0)

raise ValueError(f"No port directory associated with the board tag given {board}.")