build.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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: actions/setup-ruby@v1
  17. with:
  18. ruby-version: '2.7'
  19. - name: Checkout TinyUSB
  20. uses: actions/checkout@v2
  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. - 'imxrt'
  38. - 'lpc15'
  39. - 'lpc18'
  40. - 'lpc54'
  41. - 'lpc55'
  42. - 'mm32'
  43. - 'nrf'
  44. - 'rp2040'
  45. - 'samd11'
  46. - 'samd21'
  47. - 'samd51'
  48. - 'saml2x'
  49. - 'stm32f0'
  50. - 'stm32f1'
  51. - 'stm32f4'
  52. - 'stm32f7'
  53. - 'stm32h7'
  54. steps:
  55. - name: Setup Python
  56. uses: actions/setup-python@v2
  57. - name: Checkout TinyUSB
  58. uses: actions/checkout@v2
  59. - name: Checkout common submodules in lib
  60. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
  61. - name: Checkout hathach/linkermap
  62. uses: actions/checkout@v2
  63. with:
  64. repository: hathach/linkermap
  65. path: linkermap
  66. - name: Checkout pico-sdk
  67. if: matrix.family == 'rp2040'
  68. run: |
  69. git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
  70. echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
  71. - name: Set Toolchain URL
  72. 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
  73. - name: Cache Toolchain
  74. uses: actions/cache@v2
  75. id: cache-toolchain
  76. with:
  77. path: ~/cache/
  78. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  79. - name: Install Toolchain
  80. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  81. run: |
  82. mkdir -p ~/cache/toolchain
  83. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  84. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  85. - name: Set Toolchain Path
  86. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  87. - name: Build
  88. run: python3 tools/build_family.py ${{ matrix.family }}
  89. - name: Linker Map
  90. run: |
  91. pip install linkermap/
  92. for ex in `ls -d examples/device/*/`; do \
  93. find ${ex} -name *.map -print -quit | \
  94. xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
  95. done
  96. # ---------------------------------------
  97. # Build all no-family (opharned) boards
  98. # ---------------------------------------
  99. build-board:
  100. runs-on: ubuntu-latest
  101. strategy:
  102. fail-fast: false
  103. matrix:
  104. example:
  105. # Alphabetical order, a group of 4
  106. - 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
  107. - 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
  108. - 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
  109. - 'device/net_lwip_webserver'
  110. - 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
  111. steps:
  112. - name: Setup Python
  113. uses: actions/setup-python@v2
  114. - name: Checkout TinyUSB
  115. uses: actions/checkout@v2
  116. - name: Checkout common submodules in lib
  117. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
  118. - name: Set Toolchain URL
  119. 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
  120. - name: Cache Toolchain
  121. uses: actions/cache@v2
  122. id: cache-toolchain
  123. with:
  124. path: ~/cache/
  125. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  126. - name: Install Toolchain
  127. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  128. run: |
  129. mkdir -p ~/cache/toolchain
  130. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  131. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  132. - name: Set Toolchain Path
  133. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  134. - name: Build
  135. run: python3 tools/build_board.py ${{ matrix.example }}