build.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. name: Build
  2. on: [pull_request, push, repository_dispatch]
  3. jobs:
  4. # Unit testing with Ceedling
  5. unit-test:
  6. runs-on: ubuntu-latest
  7. steps:
  8. - name: Setup Ruby
  9. uses: actions/setup-ruby@v1
  10. - name: Checkout TinyUSB
  11. uses: actions/checkout@v2
  12. - name: Unit Tests
  13. run: |
  14. # Install Ceedling
  15. gem install ceedling
  16. cd test
  17. ceedling test:all
  18. # Build most of the ports
  19. build:
  20. runs-on: ubuntu-latest
  21. strategy:
  22. fail-fast: false
  23. matrix:
  24. example:
  25. - 'device/board_test'
  26. - 'device/cdc_dual_ports'
  27. - 'device/cdc_msc'
  28. - 'device/cdc_msc_freertos'
  29. - 'device/dfu_rt'
  30. - 'device/hid_composite'
  31. - 'device/hid_composite_freertos'
  32. - 'device/hid_generic_inout'
  33. - 'device/hid_multipleinterface'
  34. - 'device/midi_test'
  35. - 'device/msc_dual_lun'
  36. - 'device/net_lwip_webserver'
  37. - 'device/usbtmc'
  38. - 'device/webusb_serial'
  39. - 'host/cdc_msc_hid'
  40. steps:
  41. - name: Setup Python
  42. uses: actions/setup-python@v1
  43. - name: Setup Node.js
  44. uses: actions/setup-node@v1
  45. - name: Cache MSP430 Toolchain
  46. id: cache-msp430
  47. uses: actions/cache@v1
  48. with:
  49. path: /tmp/dl/
  50. # Increment gcc version number at end when updating downloads
  51. key: msp430-${{ runner.os }}-9.2.0.50
  52. - name: Install Toolchains
  53. env:
  54. MSP430GCC_URL: http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
  55. run: |
  56. # ARM & RISC-V GCC from xpack
  57. npm install --global xpm
  58. xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
  59. xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest
  60. echo "::add-path::`echo $HOME/opt/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin`"
  61. echo "::add-path::`echo $HOME/opt/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin`"
  62. # TI MSP430 GCC
  63. mkdir -p /tmp/dl/
  64. [ -f "/tmp/dl/msp430-gcc.tar.bz2" ] || wget --progress=dot:mega $MSP430GCC_URL -O /tmp/dl/msp430-gcc.tar.bz2
  65. tar -C $HOME -xaf /tmp/dl/msp430-gcc.tar.bz2
  66. echo "::add-path::`echo $HOME/msp430-gcc-*_linux64/bin`"
  67. - name: Checkout TinyUSB
  68. uses: actions/checkout@v2
  69. with:
  70. # Cannot do submodule checkout here since LWIP's git server cannot checkout unadventised commits (it must use tags)
  71. submodules: 'false'
  72. - name: Checkout Submodules
  73. run: |
  74. git submodule sync --recursive
  75. # Special case LWIP since GNU's Savannah can't do shallow checkout of non-tagged commits
  76. git submodule update --init --recursive lib/lwip
  77. git submodule update --init --recursive --depth 1
  78. - name: Build
  79. run: |
  80. python3 tools/build_all.py ${{ matrix.example }}
  81. # Build ESP32S
  82. build-esp32s:
  83. runs-on: ubuntu-latest
  84. strategy:
  85. fail-fast: false
  86. matrix:
  87. example: ['board_test', 'cdc_msc_freertos', 'hid_composite_freertos']
  88. steps:
  89. - name: Setup Python
  90. uses: actions/setup-python@v1
  91. - name: Pull ESP-IDF docker
  92. run: docker pull espressif/idf:latest
  93. - name: Checkout TinyUSB
  94. uses: actions/checkout@v2
  95. with:
  96. submodules: 'false'
  97. - name: Build
  98. run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s.py ${{ matrix.example }}