build_arm.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. name: Build ARM
  2. on:
  3. pull_request:
  4. push:
  5. release:
  6. types:
  7. - created
  8. jobs:
  9. # ---------------------------------------
  10. # Unit testing with Ceedling
  11. # ---------------------------------------
  12. unit-test:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Setup Ruby
  16. uses: ruby/setup-ruby@v1
  17. with:
  18. ruby-version: '2.7'
  19. - name: Checkout TinyUSB
  20. uses: actions/checkout@v3
  21. - name: Unit Tests
  22. run: |
  23. # Install Ceedling
  24. gem install ceedling
  25. cd test
  26. ceedling test:all
  27. # ---------------------------------------
  28. # Build ARM family
  29. # ---------------------------------------
  30. build-arm:
  31. runs-on: ubuntu-latest
  32. strategy:
  33. fail-fast: false
  34. matrix:
  35. family:
  36. # Alphabetical order
  37. - 'broadcom_32bit'
  38. - 'imxrt'
  39. - 'lpc15'
  40. - 'lpc18'
  41. - 'lpc54'
  42. - 'lpc55'
  43. - 'mm32'
  44. - 'msp432e4'
  45. - 'nrf'
  46. - 'rp2040'
  47. - 'samd11'
  48. - 'samd21'
  49. - 'samd51'
  50. - 'saml2x'
  51. - 'stm32f0'
  52. - 'stm32f1'
  53. - 'stm32f4'
  54. - 'stm32f7'
  55. - 'stm32h7'
  56. - 'stm32l4'
  57. - 'tm4c123'
  58. - 'xmc4000'
  59. steps:
  60. - name: Setup Python
  61. uses: actions/setup-python@v2
  62. - name: Checkout TinyUSB
  63. uses: actions/checkout@v3
  64. - name: Checkout common submodules in lib
  65. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
  66. - name: Checkout hathach/linkermap
  67. uses: actions/checkout@v3
  68. with:
  69. repository: hathach/linkermap
  70. path: linkermap
  71. - name: Checkout pico-sdk
  72. if: matrix.family == 'rp2040'
  73. run: |
  74. git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
  75. echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
  76. git submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB
  77. - name: Set Toolchain URL
  78. run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
  79. - name: Cache Toolchain
  80. uses: actions/cache@v2
  81. id: cache-toolchain
  82. with:
  83. path: ~/cache/
  84. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  85. - name: Install Toolchain
  86. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  87. run: |
  88. mkdir -p ~/cache/toolchain
  89. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  90. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  91. - name: Set Toolchain Path
  92. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  93. - name: Build
  94. run: python3 tools/build_family.py ${{ matrix.family }}
  95. - name: Linker Map
  96. run: |
  97. pip install linkermap/
  98. for ex in `ls -d examples/device/*/`; do \
  99. find ${ex} -name *.map -print -quit | \
  100. xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
  101. done
  102. # ---------------------------------------
  103. # Build all no-family (orphaned) boards
  104. # ---------------------------------------
  105. build-board:
  106. runs-on: ubuntu-latest
  107. strategy:
  108. fail-fast: false
  109. matrix:
  110. example:
  111. # Alphabetical order, a group of 4
  112. - 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
  113. - 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
  114. - 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
  115. - 'device/net_lwip_webserver'
  116. - 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
  117. steps:
  118. - name: Setup Python
  119. uses: actions/setup-python@v2
  120. - name: Checkout TinyUSB
  121. uses: actions/checkout@v3
  122. - name: Checkout common submodules in lib
  123. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
  124. - name: Set Toolchain URL
  125. run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
  126. - name: Cache Toolchain
  127. uses: actions/cache@v2
  128. id: cache-toolchain
  129. with:
  130. path: ~/cache/
  131. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  132. - name: Install Toolchain
  133. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  134. run: |
  135. mkdir -p ~/cache/toolchain
  136. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  137. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  138. - name: Set Toolchain Path
  139. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  140. - name: Build
  141. run: python3 tools/build_board.py ${{ matrix.example }}