tinyusb/.github/workflows/build_util.yml
Ha Thach 7cf1bdd284
Ci tweak3 (#2643)
- enable --one-per-family to build 1 board per family, also skip family if board specified in -b also present
- minimize ci run for push event
  - only build one board per family
  - skip hil test on both pi4 and hfp
- full build will be runn for PR event
- IAR always build 1 board per family regardless of event 
- update build.py to optimize make
- remove all setup python since we don't really need it
2024-05-13 20:27:49 +07:00

69 lines
1.8 KiB
YAML

name: Reusable build util
on:
workflow_call:
inputs:
build-system:
required: true
type: string
toolchain:
required: true
type: string
toolchain_url:
required: false
type: string
build-args:
required: true
type: string
one-per-family:
required: false
default: false
type: boolean
os:
required: false
type: string
default: 'ubuntu-latest'
jobs:
family:
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
matrix:
arg: ${{ fromJSON(inputs.build-args) }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4
- name: Setup Toolchain
id: setup-toolchain
uses: ./.github/actions/setup_toolchain
with:
toolchain: ${{ inputs.toolchain }}
toolchain_url: ${{ inputs.toolchain_url }}
- name: Get Dependencies
uses: ./.github/actions/get_deps
with:
arg: ${{ matrix.arg }}
- name: Set build one-per-family option
id: set-one-per-family
run: |
if [[ "${{ inputs.one-per-family }}" == "true" ]]; then
BUILD_OPTION="--one-per-family"
fi
echo "build_option=$BUILD_OPTION"
echo "build_option=$BUILD_OPTION" >> $GITHUB_OUTPUT
shell: bash
- name: Build
if: inputs.toolchain != 'esp-idf'
run: |
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
- name: Build using ESP-IDF docker
if: inputs.toolchain == 'esp-idf'
run: |
docker run --rm -v $PWD:/project -w /project espressif/idf:${{ inputs.toolchain_url }} python3 tools/build.py ${{ matrix.arg }}