summaryrefslogtreecommitdiff
path: root/.github/workflows/build_util.yml
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-05-10 18:55:43 +0700
committerGitHub <[email protected]>2024-05-10 18:55:43 +0700
commit3e2ea7750681b27238043c7158ff5508f01914a3 (patch)
tree11f9198467f561c1ff4cfd3c45e9a7b02cf9f572 /.github/workflows/build_util.yml
parentbf9cf107c638f5f674be716b8ac7cd983aa05804 (diff)
More ci tweak (#2636)
* change concurrency group to ${{ github.workflow }}-${{ github.ref }} * use argparse for build.py hil_test.py, remove the need to install click * move ci win/mac to build_cmake.yml * rename build_family.yml to build_util.yml * build_util.yml support esp32 * integrate build-espressif into build.yml * build.py support make with --board option * add get_deps action * update hil test to reuse action
Diffstat (limited to '.github/workflows/build_util.yml')
-rw-r--r--.github/workflows/build_util.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
new file mode 100644
index 000000000..f8ad1900c
--- /dev/null
+++ b/.github/workflows/build_util.yml
@@ -0,0 +1,59 @@
+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
+ 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 Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.x'
+
+ - 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: Build
+ if: inputs.toolchain != 'esp-idf'
+ run: |
+ python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.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 }}