Skip to content

Update dependencies rebased #10409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
86 changes: 86 additions & 0 deletions .github/workflows/board_builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Board Configuration Builder

on:
push:
paths:
- 'ports/**/board_setting.toml'
- '.github/workflows/board_builder.yml'
pull_request:
paths:
- 'ports/**/board_setting.toml'
- '.github/workflows/board_builder.yml'

jobs:
build-board:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install toml

- name: Find changed boards
id: changed-boards
run: |
# Get list of changed board_setting.toml files
changed_files=$(git diff --name-only HEAD^ HEAD | grep 'board_setting.toml$' || true)
if [ -z "$changed_files" ]; then
echo "No board configuration changes detected"
exit 0
fi
# Extract board directories
boards=$(echo "$changed_files" | xargs dirname | sort | uniq)
echo "::set-output name=boards::$boards"

- name: Generate board configurations
run: |
for board_dir in ${{ steps.changed-boards.outputs.boards }}; do
echo "Generating config for $board_dir"
python tools/generate_board_config.py "$board_dir"
done

- name: Set up build environment
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi
# Add other port-specific dependencies here

- name: Build firmware
run: |
for board_dir in ${{ steps.changed-boards.outputs.boards }}; do
port=$(echo "$board_dir" | cut -d'/' -f2)
board=$(basename "$board_dir")
echo "Building $board for $port"
make -C ports/$port BOARD=$board
done

- name: Run tests
run: |
for board_dir in ${{ steps.changed-boards.outputs.boards }}; do
port=$(echo "$board_dir" | cut -d'/' -f2)
board=$(basename "$board_dir")
echo "Testing $board for $port"
make -C ports/$port BOARD=$board test
done

- name: Upload firmware artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: firmware-binaries
path: |
ports/**/build-*/firmware.bin
ports/**/build-*/firmware.uf2
Loading