mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
162 lines
4.3 KiB
YAML
162 lines
4.3 KiB
YAML
name: Build ARM
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
release:
|
|
types:
|
|
- created
|
|
|
|
jobs:
|
|
# ---------------------------------------
|
|
# Unit testing with Ceedling
|
|
# ---------------------------------------
|
|
unit-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '2.7'
|
|
|
|
- name: Checkout TinyUSB
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Unit Tests
|
|
run: |
|
|
# Install Ceedling
|
|
gem install ceedling
|
|
cd test
|
|
ceedling test:all
|
|
|
|
# ---------------------------------------
|
|
# Build ARM family
|
|
# ---------------------------------------
|
|
build-arm:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
family:
|
|
# Alphabetical order
|
|
- 'broadcom_32bit'
|
|
- 'imxrt'
|
|
- 'lpc15'
|
|
- 'lpc18'
|
|
- 'lpc54'
|
|
- 'lpc55'
|
|
- 'mm32'
|
|
- 'msp432e4'
|
|
- 'nrf'
|
|
- 'rp2040'
|
|
- 'samd11'
|
|
- 'samd21'
|
|
- 'samd51'
|
|
- 'saml2x'
|
|
- 'stm32f0'
|
|
- 'stm32f1'
|
|
- 'stm32f4'
|
|
- 'stm32f7'
|
|
- 'stm32g4'
|
|
- 'stm32h7'
|
|
- 'stm32l4'
|
|
- 'stm32wb'
|
|
- 'tm4c123'
|
|
- 'xmc4000'
|
|
steps:
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v3
|
|
|
|
- name: Install ARM GCC
|
|
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
|
with:
|
|
release: '11.2-2022.02'
|
|
|
|
- name: Checkout TinyUSB
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Checkout common submodules in lib
|
|
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
|
|
|
|
- name: Checkout hathach/linkermap
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: hathach/linkermap
|
|
path: linkermap
|
|
|
|
- name: Checkout pico-sdk for rp2040
|
|
if: matrix.family == 'rp2040'
|
|
run: |
|
|
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
|
|
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
|
|
|
|
- name: Get Dependencies
|
|
run: python3 tools/get_dependencies.py ${{ matrix.family }}
|
|
|
|
- name: Build
|
|
run: python3 tools/build_family.py ${{ matrix.family }}
|
|
|
|
- name: Linker Map
|
|
run: |
|
|
pip install linkermap/
|
|
# find -quit to only print map of 1 board per example
|
|
for ex in `ls -d examples/*/*/`; do \
|
|
find ${ex} -name *.map -print -quit | \
|
|
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
|
|
done
|
|
|
|
# Following steps are for Hardware Test with self-hosted
|
|
|
|
- name: Prepare Artifacts
|
|
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
|
|
run: find examples/ -name "*.elf" -exec mv {} . \;
|
|
|
|
- name: Upload Artifacts for Hardware Test
|
|
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.family }}
|
|
path: |
|
|
*.elf
|
|
|
|
- name: Trigger Hardware Test
|
|
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
with:
|
|
workflow: Hardware Test
|
|
token: ${{ secrets.TRIGGER_SELF_HOSTED }}
|
|
|
|
# ---------------------------------------
|
|
# Build all no-family (orphaned) boards
|
|
# ---------------------------------------
|
|
build-board:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
example:
|
|
# Alphabetical order, a group of 4
|
|
- 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
|
|
- 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
|
|
- 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
|
|
- 'device/net_lwip_webserver'
|
|
- 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
|
|
|
|
steps:
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v3
|
|
|
|
- name: Install ARM GCC
|
|
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
|
with:
|
|
release: '11.2-2022.02'
|
|
|
|
- name: Checkout TinyUSB
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Checkout common submodules in lib
|
|
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
|
|
|
|
- name: Build
|
|
run: python3 tools/build_board.py ${{ matrix.example }}
|