build.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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: ['board_test', 'cdc_dual_ports', 'cdc_msc', 'cdc_msc_freertos', 'dfu_rt',
  25. 'hid_composite', 'hid_generic_inout', 'midi_test', 'msc_dual_lun', 'net_lwip_webserver',
  26. 'usbtmc', 'webusb_serial']
  27. steps:
  28. - name: Setup Python
  29. uses: actions/setup-python@v1
  30. - name: Setup Node.js
  31. uses: actions/setup-node@v1
  32. - name: Cache MSP430 Toolchain
  33. id: cache-msp430
  34. uses: actions/cache@v1
  35. with:
  36. path: /tmp/dl/
  37. # Increment serial number at end when updating downloads
  38. key: msp430-${{ runner.os }}-0
  39. - name: Install Toolchains
  40. run: |
  41. # ARM & RISC-V GCC from xpack
  42. npm install --global xpm
  43. xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest
  44. xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest
  45. echo "::add-path::`echo $HOME/opt/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin`"
  46. echo "::add-path::`echo $HOME/opt/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin`"
  47. # TI MSP430 GCC
  48. mkdir -p /tmp/dl/
  49. [ -f "/tmp/dl/msp430-gcc.tar.bz2" ] || wget --progress=dot:mega http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/8_3_0_0/exports/msp430-gcc-8.3.0.16_linux64.tar.bz2 -O /tmp/dl/msp430-gcc.tar.bz2
  50. tar -C $HOME -xaf /tmp/dl/msp430-gcc.tar.bz2
  51. echo "::add-path::`echo $HOME/msp430-gcc-*_linux64/bin`"
  52. - name: Checkout TinyUSB
  53. uses: actions/checkout@v2
  54. with:
  55. # Cannot do submodule checkout here since LWIP's git server cannot checkout unadventised commits (it must use tags)
  56. submodules: 'false'
  57. - name: Checkout Submodules
  58. run: |
  59. git submodule sync --recursive
  60. # Special case LWIP since GNU's Savannah can't do shallow checkout of non-tagged commits
  61. git submodule update --init --recursive lib/lwip
  62. git submodule update --init --recursive --depth 1
  63. - name: Build
  64. run: |
  65. . $HOME/esp-idf/export.sh
  66. python3 tools/build_all.py ${{ matrix.example }}
  67. # Build ESP32S
  68. build-esp32s:
  69. runs-on: ubuntu-latest
  70. steps:
  71. - name: Setup Python
  72. uses: actions/setup-python@v1
  73. - name: Install Toolchains
  74. run: |
  75. git clone --depth 1 https://github.com/espressif/esp-idf.git $HOME/esp-idf
  76. cd $HOME/esp-idf
  77. ./install.sh
  78. - name: Checkout TinyUSB
  79. uses: actions/checkout@v2
  80. with:
  81. submodules: 'false'
  82. - name: Build
  83. run: |
  84. . $HOME/esp-idf/export.sh
  85. cd examples/device/cdc_msc_freertos
  86. idf.py build