summaryrefslogtreecommitdiff
path: root/.github/workflows/build_util.yml
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-06-22 21:30:58 +0200
committerHiFiPhile <[email protected]>2026-06-22 21:30:58 +0200
commit693cdce08e14833f26f4e8a1f26e4fd546be4c35 (patch)
tree7667d2223dc32d9f21b5b60ab200e64ed46e3e20 /.github/workflows/build_util.yml
parent41e9eaa65a935136085d78ec4b99c81ff991b560 (diff)
parentcd3561bf158afd5a5718904b8139a338d1e3b67c (diff)
Merge remote-tracking branch 'tinyusb/master' into pr-osal-spin-deinit
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to '.github/workflows/build_util.yml')
-rw-r--r--.github/workflows/build_util.yml70
1 files changed, 49 insertions, 21 deletions
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index a2c96f3c0..2532caebe 100644
--- a/.github/workflows/build_util.yml
+++ b/.github/workflows/build_util.yml
@@ -3,6 +3,10 @@ name: Reusable build util
on:
workflow_call:
inputs:
+ os:
+ required: false
+ type: string
+ default: 'ubuntu-latest'
build-system:
required: true
type: string
@@ -12,18 +16,26 @@ on:
build-args:
required: true
type: string
- one-per-family:
+ build-options:
+ required: false
+ default: ''
+ type: string
+ upload-artifacts:
required: false
default: false
type: boolean
- upload-artifacts:
+ upload-metrics:
required: false
default: false
type: boolean
- os:
+ upload-membrowse:
required: false
- type: string
- default: 'ubuntu-latest'
+ default: false
+ type: boolean
+ code-changed:
+ required: false
+ default: true
+ type: boolean
jobs:
family:
@@ -34,7 +46,9 @@ jobs:
arg: ${{ fromJSON(inputs.build-args) }}
steps:
- name: Checkout TinyUSB
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: ${{ !inputs.upload-membrowse && 1 || 0 }}
- name: Setup Toolchain
id: setup-toolchain
@@ -47,32 +61,45 @@ jobs:
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.code-changed }}
env:
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
run: |
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
- docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py ${{ matrix.arg }}
+ docker run --rm -e MEMBROWSE_API_KEY="$MEMBROWSE_API_KEY" -e CI="$CI" -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py --target all ${{ matrix.arg }}
else
- python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
+ BUILD_PY_ARGS="-s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ inputs.build-options }} --target all"
+ if [ "${{ inputs.upload-metrics }}" = "true" ]; then
+ BUILD_PY_ARGS="$BUILD_PY_ARGS --target tinyusb_metrics"
+ fi
+ python tools/build.py $BUILD_PY_ARGS ${{ matrix.arg }}
fi
shell: bash
+ - name: Membrowse Upload
+ if: inputs.toolchain != 'esp-idf' && inputs.upload-membrowse == true
+ continue-on-error: true
+ env:
+ MEMBROWSE_API_KEY: ${{ secrets.MEMBROWSE_API_KEY }}
+ run: |
+ # if code-changed is false --> there is no elf -> membrowse target upload with --identical flag
+ BUILD_PY_ARGS="-s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ inputs.build-options }}"
+ python tools/build.py $BUILD_PY_ARGS --target examples-membrowse-upload -j 1 ${{ matrix.arg }}
+ shell: bash
+
+ - name: Upload Artifacts for Metrics
+ if: inputs.upload-metrics == true && inputs.code-changed == true
+ uses: actions/upload-artifact@v7
+ with:
+ name: metrics-${{ matrix.arg }}
+ path: cmake-build/cmake-build-*/metrics.json
+
- name: Upload Artifacts for Hardware Testing
- if: ${{ inputs.upload-artifacts }}
- uses: actions/upload-artifact@v4
+ if: inputs.upload-artifacts == true && inputs.code-changed == true
+ uses: actions/upload-artifact@v7
with:
- name: ${{ matrix.arg }}
+ name: binaries-${{ matrix.arg }}
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
@@ -81,3 +108,4 @@ jobs:
cmake-build/cmake-build-*/*/*/partition_table/partition-table.bin
cmake-build/cmake-build-*/*/*/config.env
cmake-build/cmake-build-*/*/*/flash_args
+ cmake-build/hw/mcu/**/*.ld