Improved manual build flow to make it easier (#8839)
* Improved flow to make easier The emojis are intentional! I had minimal LLM input!!! * try and fix input variable sanitisation * and again * again * Copilot fixed it for me * copilot didn't fix it for me * copilot might have fixed it and I broke it by copypasting --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
co-authored by
GitHub
Ben Meadors
parent
0746f8cfff
commit
f88bc732cc
@@ -4,9 +4,14 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
# trunk-ignore(checkov/CKV_GHA_7)
|
# trunk-ignore(checkov/CKV_GHA_7)
|
||||||
|
target:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
description: Choose the target board, e.g. nrf52_promicro_diy_tcxo. If blank, will find available targets.
|
||||||
arch:
|
arch:
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
|
- all
|
||||||
- esp32
|
- esp32
|
||||||
- esp32s3
|
- esp32s3
|
||||||
- esp32c3
|
- esp32c3
|
||||||
@@ -15,32 +20,18 @@ on:
|
|||||||
- rp2040
|
- rp2040
|
||||||
- rp2350
|
- rp2350
|
||||||
- stm32
|
- stm32
|
||||||
target:
|
description: Choose an arch to limit the search, or 'all' to search all architectures.
|
||||||
type: string
|
default: all
|
||||||
required: false
|
|
||||||
description: Choose the target board, e.g. nrf52_promicro_diy_tcxo. If blank, will find available targets.
|
|
||||||
# find-target:
|
|
||||||
# type: boolean
|
|
||||||
# default: true
|
|
||||||
# description: 'Find the available targets'
|
|
||||||
|
|
||||||
permissions: read-all
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
find-targets:
|
find-targets:
|
||||||
if: ${{ inputs.target == '' }}
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch:
|
arch:
|
||||||
- esp32
|
- all
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
@@ -51,14 +42,37 @@ jobs:
|
|||||||
- run: pip install -U platformio
|
- run: pip install -U platformio
|
||||||
- name: Generate matrix
|
- name: Generate matrix
|
||||||
id: jsonStep
|
id: jsonStep
|
||||||
|
env:
|
||||||
|
BUILDTARGET: ${{ inputs.target }}
|
||||||
|
MATRIXARCH: ${{ inputs.arch }}
|
||||||
run: |
|
run: |
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level extra)
|
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level extra)
|
||||||
echo "Name: $GITHUB_REF_NAME" >> $GITHUB_STEP_SUMMARY
|
if [ "$BUILDTARGET" = "" ]; then
|
||||||
echo "Base: $GITHUB_BASE_REF" >> $GITHUB_STEP_SUMMARY
|
echo "Name: $GITHUB_REF_NAME" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Arch: ${{matrix.arch}}" >> $GITHUB_STEP_SUMMARY
|
echo "Base: $GITHUB_BASE_REF" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Ref: $GITHUB_REF" >> $GITHUB_STEP_SUMMARY
|
echo "Arch: $MATRIXARCH" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Targets:" >> $GITHUB_STEP_SUMMARY
|
echo "Ref: $GITHUB_REF" >> $GITHUB_STEP_SUMMARY
|
||||||
echo $TARGETS | jq -r 'sort_by(.board) |.[] | "- " + .board' >> $GITHUB_STEP_SUMMARY
|
echo "## 🎯 The following target boards are available to build:" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Platform | Board |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| -------- | ----- |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo $TARGETS | jq -r 'sort_by(.board) | sort_by(.platform) |.[] | "| " + .platform + " | " + .board + " |" ' >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "We build this one:" >> $GITHUB_STEP_SUMMARY
|
||||||
|
ARCH=$(echo "$TARGETS" | jq --arg BUILDTARGET "$BUILDTARGET" -r '.[] | select(.board==$BUILDTARGET) | .platform')
|
||||||
|
echo "| Platform | Board |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| -------- | ----- |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| $ARCH | "$BUILDTARGET" |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
if [[ "$ARCH" == "" ]]; then
|
||||||
|
echo "## ❌ Error: Target "$BUILDTARGET" not found!" >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "## ✅ Target "$BUILDTARGET" found, proceeding to build." >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
echo "You may need to refresh this page to make the built firmware appear below." >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "arch=$ARCH" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
outputs:
|
||||||
|
arch: ${{ steps.jsonStep.outputs.arch }}
|
||||||
|
|
||||||
version:
|
version:
|
||||||
if: ${{ inputs.target != '' }}
|
if: ${{ inputs.target != '' }}
|
||||||
@@ -78,12 +92,12 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
if: ${{ inputs.target != '' && inputs.arch != 'native' }}
|
if: ${{ inputs.target != '' && inputs.arch != 'native' }}
|
||||||
needs: [version]
|
needs: [version, find-targets]
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
uses: ./.github/workflows/build_firmware.yml
|
||||||
with:
|
with:
|
||||||
version: ${{ needs.version.outputs.long }}
|
version: ${{ needs.version.outputs.long }}
|
||||||
pio_env: ${{ inputs.target }}
|
pio_env: ${{ inputs.target }}
|
||||||
platform: ${{ inputs.arch }}
|
platform: ${{ needs.find-targets.outputs.arch }}
|
||||||
|
|
||||||
gather-artifacts:
|
gather-artifacts:
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
Reference in New Issue
Block a user