Build #2594
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | ||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'src/**' | ||
- 'examples/**' | ||
- 'lib/**' | ||
- 'hw/**' | ||
- 'tools/get_deps.py' | ||
- 'tools/build.py' | ||
- '.github/actions/**' | ||
- '.github/workflows/build.yml' | ||
- '.github/workflows/build_util.yml' | ||
- '.github/workflows/ci_set_matrix.py' | ||
pull_request: | ||
branches: [ master ] | ||
paths: | ||
- 'src/**' | ||
- 'examples/**' | ||
- 'lib/**' | ||
- 'hw/**' | ||
- 'tools/get_deps.py' | ||
- 'tools/build.py' | ||
- '.github/actions/**' | ||
- '.github/workflows/build.yml' | ||
- '.github/workflows/build_util.yml' | ||
- '.github/workflows/ci_set_matrix.py' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
set-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
json: ${{ steps.set-matrix-json.outputs.matrix }} | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Checkout TinyUSB | ||
uses: actions/checkout@v4 | ||
- name: Generate matrix json | ||
id: set-matrix-json | ||
run: | | ||
MATRIX_JSON=$(python .github/workflows/ci_set_matrix.py) | ||
echo "matrix=$MATRIX_JSON" | ||
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT | ||
# --------------------------------------- | ||
# Build CMake | ||
# --------------------------------------- | ||
cmake: | ||
needs: set-matrix | ||
uses: ./.github/workflows/build_util.yml | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: | ||
- 'aarch64-gcc' | ||
- 'arm-clang' | ||
- 'arm-gcc' | ||
- 'msp430-gcc' | ||
- 'riscv-gcc' | ||
if: >- | ||
Check failure on line 70 in .github/workflows/build.yml GitHub Actions / BuildInvalid workflow file
|
||
matrix.toolchain != 'arm-clang' || | ||
github.event_name == 'pull_request' || | ||
(github.event_name == 'push' && github.ref == 'refs/heads/master') | ||
with: | ||
build-system: 'cmake' | ||
toolchain: ${{ matrix.toolchain }} | ||
toolchain_url: ${{ fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].toolchain_url }} | ||
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }} | ||
# --------------------------------------- | ||
# Build Make | ||
# --------------------------------------- | ||
make: | ||
if: >- | ||
github.event_name == 'pull_request' || | ||
(github.event_name == 'push' && github.ref == 'refs/heads/master') | ||
needs: set-matrix | ||
uses: ./.github/workflows/build_util.yml | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: | ||
- 'aarch64-gcc' | ||
#- 'arm-clang' | ||
- 'arm-gcc' | ||
- 'msp430-gcc' | ||
- 'riscv-gcc' | ||
with: | ||
build-system: 'make' | ||
toolchain: ${{ matrix.toolchain }} | ||
toolchain_url: ${{ fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].toolchain_url }} | ||
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }} | ||
# --------------------------------------- | ||
# Build Make on Windows/MacOS | ||
# --------------------------------------- | ||
make-os: | ||
uses: ./.github/workflows/build_util.yml | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-latest, macos-latest] | ||
with: | ||
os: ${{ matrix.os }} | ||
build-system: 'make' | ||
toolchain: 'arm-gcc' | ||
build-args: '["-bstm32f411disco"]' | ||
# --------------------------------------- | ||
# Build Espressif | ||
# --------------------------------------- | ||
espressif: | ||
uses: ./.github/workflows/build_util.yml | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
board: | ||
# ESP32-S2 | ||
- 'espressif_kaluga_1' | ||
# ESP32-S3 skip since devkitm is also compiled in hil-test workflow | ||
#- 'espressif_s3_devkitm' | ||
with: | ||
build-system: 'cmake' | ||
toolchain: 'esp-idf' | ||
toolchain_url: 'v5.1.1' | ||
build-args: '["-b${{ matrix.board }}"]' |