mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-15 08:28:08 +00:00
* Add support for RNDIS board and enhance camera initialization - Included rndis_board.cc in the build for ESP32S3 and ESP32P4 targets. - Updated camera initialization logic in esp32s3_korvo2_v3_board.cc and esp32s3_korvo2_v3_board.cc to use a more structured camera_config_t setup. - Improved code readability by refining comments and formatting in the camera initialization functions. * Remove outdated camera configuration options from esp32s3-korvo2-v3-rndis config.json to streamline setup and improve clarity. * Update IDF version in build configuration and component dependencies to v5.5.2 for improved compatibility. * update discord links --------- Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
112 lines
3.2 KiB
YAML
112 lines
3.2 KiB
YAML
name: Build Boards
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- ci/* # for ci test
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Determine variants to build
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
variants: ${{ steps.select.outputs.variants }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install jq
|
|
run: sudo apt-get update && sudo apt-get install -y jq
|
|
|
|
- id: list
|
|
name: Get all variant list
|
|
run: |
|
|
echo "all_variants=$(python scripts/release.py --list-boards --json)" >> $GITHUB_OUTPUT
|
|
|
|
- id: select
|
|
name: Select variants based on changes
|
|
env:
|
|
ALL_VARIANTS: ${{ steps.list.outputs.all_variants }}
|
|
run: |
|
|
EVENT_NAME="${{ github.event_name }}"
|
|
|
|
# push 到 main 分支,编译全部变体
|
|
if [[ "$EVENT_NAME" == "push" ]]; then
|
|
echo "variants=$ALL_VARIANTS" >> $GITHUB_OUTPUT
|
|
exit 0
|
|
fi
|
|
|
|
# pull_request 场景
|
|
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
|
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
|
echo "Base: $BASE_SHA, Head: $HEAD_SHA"
|
|
|
|
CHANGED=$(git diff --name-only $BASE_SHA $HEAD_SHA || true)
|
|
echo -e "Changed files:\n$CHANGED"
|
|
|
|
NEED_ALL=0
|
|
declare -A AFFECTED
|
|
while IFS= read -r file; do
|
|
if [[ "$file" == main/* && "$file" != main/boards/* ]]; then
|
|
NEED_ALL=1
|
|
fi
|
|
|
|
if [[ "$file" == main/boards/common/* ]]; then
|
|
NEED_ALL=1
|
|
fi
|
|
|
|
if [[ "$file" == main/boards/* ]]; then
|
|
board=$(echo "$file" | cut -d '/' -f3)
|
|
AFFECTED[$board]=1
|
|
fi
|
|
done <<< "$CHANGED"
|
|
|
|
if [[ "$NEED_ALL" -eq 1 ]]; then
|
|
echo "variants=$ALL_VARIANTS" >> $GITHUB_OUTPUT
|
|
else
|
|
if [[ ${#AFFECTED[@]} -eq 0 ]]; then
|
|
echo "variants=[]" >> $GITHUB_OUTPUT
|
|
else
|
|
BOARDS_JSON=$(printf '%s\n' "${!AFFECTED[@]}" | sort -u | jq -R -s -c 'split("\n")[:-1]')
|
|
FILTERED=$(echo "$ALL_VARIANTS" | jq -c --argjson boards "$BOARDS_JSON" 'map(select(.board as $b | $boards | index($b)))')
|
|
echo "variants=$FILTERED" >> $GITHUB_OUTPUT
|
|
fi
|
|
fi
|
|
|
|
build:
|
|
name: Build ${{ matrix.name }}
|
|
needs: prepare
|
|
if: ${{ needs.prepare.outputs.variants != '[]' }}
|
|
strategy:
|
|
fail-fast: false # 单个变体失败不影响其它变体
|
|
matrix:
|
|
include: ${{ fromJson(needs.prepare.outputs.variants) }}
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: espressif/idf:v5.5.2
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build current variant
|
|
shell: bash
|
|
run: |
|
|
source $IDF_PATH/export.sh
|
|
python scripts/release.py ${{ matrix.board }} --name ${{ matrix.name }}
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: xiaozhi_${{ matrix.name }}_${{ github.sha }}.bin
|
|
path: build/merged-binary.bin
|
|
if-no-files-found: error
|