build.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. - 'nrf'
  43. - 'rp2040'
  44. - 'samd11'
  45. - 'samd21'
  46. - 'samd51'
  47. - 'saml2x'
  48. - 'stm32f0'
  49. - 'stm32f1'
  50. - 'stm32f4'
  51. - 'stm32f7'
  52. - 'stm32h7'
  53. steps:
  54. - name: Setup Python
  55. uses: actions/setup-python@v2
  56. - name: Checkout TinyUSB
  57. uses: actions/checkout@v2
  58. - name: Checkout common submodules in lib
  59. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
  60. - name: Checkout pico-sdk
  61. if: matrix.family == 'rp2040'
  62. run: |
  63. git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
  64. echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
  65. - name: Set Toolchain URL
  66. 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
  67. - name: Cache Toolchain
  68. uses: actions/cache@v2
  69. id: cache-toolchain
  70. with:
  71. path: ~/cache/
  72. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  73. - name: Install Toolchain
  74. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  75. run: |
  76. mkdir -p ~/cache/toolchain
  77. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  78. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  79. - name: Set Toolchain Path
  80. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  81. - name: Build
  82. run: python3 tools/build_family.py ${{ matrix.family }}
  83. # ---------------------------------------
  84. # Build all no-family (opharned) boards
  85. # ---------------------------------------
  86. build-board:
  87. runs-on: ubuntu-latest
  88. strategy:
  89. fail-fast: false
  90. matrix:
  91. example:
  92. # Alphabetical order, a group of 4
  93. - 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
  94. - 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
  95. - 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
  96. - 'device/net_lwip_webserver'
  97. - 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
  98. steps:
  99. - name: Setup Python
  100. uses: actions/setup-python@v2
  101. - name: Checkout TinyUSB
  102. uses: actions/checkout@v2
  103. - name: Checkout common submodules in lib
  104. run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
  105. - name: Set Toolchain URL
  106. 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
  107. - name: Cache Toolchain
  108. uses: actions/cache@v2
  109. id: cache-toolchain
  110. with:
  111. path: ~/cache/
  112. key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
  113. - name: Install Toolchain
  114. if: steps.cache-toolchain.outputs.cache-hit != 'true'
  115. run: |
  116. mkdir -p ~/cache/toolchain
  117. wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
  118. tar -C ~/cache/toolchain -xaf toolchain.tar.gz
  119. - name: Set Toolchain Path
  120. run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
  121. - name: Build
  122. run: python3 tools/build_board.py ${{ matrix.example }}