build.yml 4.1 KB

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