add get-dependencies.py

This commit is contained in:
hathach 2022-07-01 17:23:14 +07:00
parent 5323472afd
commit 53db23142a
7 changed files with 45 additions and 9 deletions

View File

@ -55,6 +55,9 @@ jobs:
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}

View File

@ -89,12 +89,9 @@ jobs:
run: |
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
git submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB
- name: Get Dependencies
run: |
b=`find hw/bsp/${{ matrix.family }}/boards -depth -maxdepth 1 -type d -name '[^.]?*' -printf %f -quit`
make -C examples/device/board_test BOARD=${b} get-deps
run: python3 tools/get_dependencies.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@ -127,16 +124,16 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '11.2-2022.02'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '11.2-2022.02'
- name: Build
run: python3 tools/build_board.py ${{ matrix.example }}

View File

@ -52,6 +52,9 @@ jobs:
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}

View File

@ -53,6 +53,9 @@ jobs:
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}

View File

@ -53,6 +53,9 @@ jobs:
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}

View File

@ -1,6 +1,8 @@
JLINK_DEVICE = rp2040_m0_0
PYOCD_TARGET = rp2040
DEPS_SUBMODULES += hw/mcu/raspberry_pi/Pico-PIO-USB
ifeq ($(DEBUG), 1)
CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug
endif

25
tools/get_dependencies.py Normal file
View File

@ -0,0 +1,25 @@
import os
import sys
import subprocess
# dependency lookup (ABC sorted)
# deps = {
# 'LPC11UXX' : [ [] ]
# }
def get_family_dep(family):
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
if entry.is_dir():
result = subprocess.run("make -C examples/device/board_test BOARD={} get-deps".format(entry.name),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print(result.stdout.decode("utf-8"))
return result.returncode
status = 0
all_family = sys.argv[1:]
for f in all_family:
status += get_family_dep(f)
sys.exit(status)