split raspberrypi and refactor espressif

This commit is contained in:
MicroDev 2023-02-14 20:33:24 +05:30
parent 65e9d937ac
commit 50c52fca88
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
5 changed files with 42 additions and 46 deletions

View File

@ -8,7 +8,7 @@ inputs:
options:
- arm
- aarch
- espressif
- esp
- riscv
- none
@ -42,13 +42,13 @@ runs:
with:
release: '10-2020-q4'
# espressif
- name: Get espressif toolchain
if: inputs.platform == 'espressif'
# esp
- name: Get esp toolchain
if: inputs.platform == 'esp'
run: sudo apt-get install -y ninja-build
shell: bash
- name: Install IDF tools
if: inputs.platform == 'espressif'
if: inputs.platform == 'esp'
run: |
echo "Installing ESP-IDF tools"
$IDF_PATH/tools/idf_tools.py --non-interactive install required
@ -58,7 +58,7 @@ runs:
rm -rf $IDF_TOOLS_PATH/dist
shell: bash
- name: Set environment
if: inputs.platform == 'espressif'
if: inputs.platform == 'esp'
run: |
source $IDF_PATH/export.sh
echo >> $GITHUB_ENV "IDF_PYTHON_ENV_PATH=$IDF_PYTHON_ENV_PATH"
@ -75,7 +75,7 @@ runs:
# common
- name: Cache python dependencies
if: inputs.platform != 'espressif'
if: inputs.platform != 'esp'
uses: ./.github/actions/deps/python
with:
action: ${{ fromJSON('["restore", "cache"]')[github.job == 'scheduler'] }}

View File

@ -1,27 +1,15 @@
name: Fetch port deps
inputs:
platform:
required: false
default: none
type: choice
options:
- espressif
- none
name: Fetch espressif port deps
runs:
using: composite
steps:
# espressif
- name: Set IDF env
if: inputs.platform == 'espressif'
run: |
echo >> $GITHUB_ENV "IDF_PATH=$GITHUB_WORKSPACE/ports/espressif/esp-idf"
echo >> $GITHUB_ENV "IDF_TOOLS_PATH=$GITHUB_WORKSPACE/.idf_tools"
shell: bash
- name: Get IDF commit
if: inputs.platform == 'espressif'
id: idf-commit
run: |
COMMIT=$(git submodule status ports/espressif/esp-idf | grep -o -P '(?<=^-).*(?= )')
@ -30,7 +18,6 @@ runs:
shell: bash
- name: Cache IDF submodules
if: inputs.platform == 'espressif'
uses: actions/cache@v3
with:
path: |
@ -39,13 +26,11 @@ runs:
key: submodules-idf-${{ steps.idf-commit.outputs.commit }}
- name: Cache IDF tools
if: inputs.platform == 'espressif'
uses: actions/cache@v3
with:
path: ${{ env.IDF_TOOLS_PATH }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-tools-idf-${{ steps.idf-commit.outputs.commit }}
- name: Initialize IDF submodules
if: inputs.platform == 'espressif'
run: git submodule update --init --depth=1 --recursive $IDF_PATH
shell: bash

View File

@ -35,9 +35,8 @@ jobs:
with:
python-version: 3.x
- name: Set up port
uses: ./.github/actions/deps/port
with:
platform: ${{ inputs.platform }}
if: inputs.platform == 'esp'
uses: ./.github/actions/deps/ports/espressif
- name: Set up submodules
id: set-up-submodules
uses: ./.github/actions/deps/submodules

View File

@ -24,8 +24,9 @@ jobs:
build-boards: ${{ steps.set-matrix.outputs.build-boards }}
boards-aarch: ${{ steps.set-matrix.outputs.boards-aarch }}
boards-arm: ${{ steps.set-matrix.outputs.boards-arm }}
boards-espressif: ${{ steps.set-matrix.outputs.boards-espressif }}
boards-esp: ${{ steps.set-matrix.outputs.boards-esp }}
boards-riscv: ${{ steps.set-matrix.outputs.boards-riscv }}
boards-rpi: ${{ steps.set-matrix.outputs.boards-rpi }}
cp-version: ${{ steps.set-up-submodules.outputs.version }}
steps:
- name: Dump GitHub context
@ -238,13 +239,13 @@ jobs:
cp-version: ${{ needs.scheduler.outputs.cp-version }}
espressif:
esp:
needs: [scheduler, mpy-cross, tests]
if: ${{ needs.scheduler.outputs.boards-espressif != '[]' }}
if: ${{ needs.scheduler.outputs.boards-esp != '[]' }}
uses: ./.github/workflows/build-boards.yml
with:
platform: espressif
boards: ${{ needs.scheduler.outputs.boards-espressif }}
platform: esp
boards: ${{ needs.scheduler.outputs.boards-esp }}
cp-version: ${{ needs.scheduler.outputs.cp-version }}
@ -256,3 +257,12 @@ jobs:
platform: riscv
boards: ${{ needs.scheduler.outputs.boards-riscv }}
cp-version: ${{ needs.scheduler.outputs.cp-version }}
rpi:
needs: [scheduler, mpy-cross, tests]
if: ${{ needs.scheduler.outputs.boards-rpi != '[]' }}
uses: ./.github/workflows/build-boards.yml
with:
platform: arm
boards: ${{ needs.scheduler.outputs.boards-rpi }}
cp-version: ${{ needs.scheduler.outputs.cp-version }}

View File

@ -46,11 +46,11 @@ PORT_TO_ARCH = {
"atmel-samd": "arm",
"broadcom": "aarch",
"cxd56": "arm",
"espressif": "espressif",
"espressif": "esp",
"litex": "riscv",
"mimxrt10xx": "arm",
"nrf": "arm",
"raspberrypi": "arm",
"raspberrypi": "rpi",
"stm": "arm",
}
@ -204,31 +204,33 @@ def set_boards_to_build(build_all: bool):
break
# Split boards by architecture.
arch_to_boards = {"aarch": [], "arm": [], "esp": [], "riscv": [], "rpi": []}
# Append previously failed boards
for arch in arch_to_boards:
arch_to_job = f"build-{arch}"
if arch_to_job in last_failed_jobs:
for board in last_failed_jobs[arch_to_job]:
if not board in boards_to_build:
boards_to_build.append(board)
build_boards = bool(boards_to_build)
print("Building boards:", build_boards)
set_output("build-boards", build_boards)
arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []}
# Append boards according to arch
for board in sorted(boards_to_build):
print(" ", board)
port = board_to_port.get(board)
# A board can appear due to its _deletion_ (rare)
# if this happens it's not in `board_to_port`.
if not port:
continue
arch = PORT_TO_ARCH[port]
arch_to_boards[arch].append(board)
arch_to_boards[PORT_TO_ARCH[port]].append(board)
print(" ", board)
# Set the step outputs for each architecture
for arch in arch_to_boards:
# Append previous failed jobs
if f"build-{arch}" in last_failed_jobs:
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])))
set_output(f"boards-{arch}", json.dumps(arch_to_boards[arch]))
def set_docs_to_build(build_doc: bool):