build.yml 3.5 KB

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